|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
public abstract class StreamRepresentation
Representation based on a BIO stream.
Field Summary |
---|
Fields inherited from class org.restlet.resource.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
StreamRepresentation(MediaType mediaType)
Constructor. |
Method Summary | |
---|---|
java.nio.channels.ReadableByteChannel |
getChannel()
Returns a channel with the representation's content. If it is supported by a file, a read-only instance of FileChannel is returned. This method is ensured to return a fresh channel for each invocation unless it is a transient representation, in which case null is returned. |
java.io.Reader |
getReader()
Returns a characters reader with the representation's content. |
void |
write(java.nio.channels.WritableByteChannel writableChannel)
Writes the representation to a byte channel. |
void |
write(java.io.Writer writer)
Writes the representation to a characters writer. |
Methods inherited from class org.restlet.resource.Representation |
---|
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDownloadName, getExpirationDate, getModificationDate, getRange, getSize, getStream, getTag, getText, isAvailable, isDownloadable, isTransient, release, setAvailable, setDigest, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setRange, setSize, setTag, setTransient, write |
Methods inherited from class org.restlet.resource.Variant |
---|
getCharacterSet, getEncodings, getIdentifier, getLanguages, getMediaType, setCharacterSet, setEncodings, setIdentifier, setIdentifier, setLanguages, setMediaType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamRepresentation(MediaType mediaType)
mediaType
- The media type.Method Detail |
---|
public java.nio.channels.ReadableByteChannel getChannel() throws java.io.IOException
Representation
getChannel
in class Representation
java.io.IOException
public java.io.Reader getReader() throws java.io.IOException
Representation
getReader
in class Representation
java.io.IOException
public void write(java.nio.channels.WritableByteChannel writableChannel) throws java.io.IOException
Representation
write
in class Representation
writableChannel
- A writable byte channel.
java.io.IOException
public void write(java.io.Writer writer) throws java.io.IOException
Representation
write
in class Representation
writer
- The characters writer.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |