public abstract class CharacterRepresentation extends Representation
UNKNOWN_SIZE| Constructor and Description |
|---|
CharacterRepresentation(MediaType mediaType)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.InputStream |
getStream()
Returns a stream with the representation's content.
|
void |
write(java.io.OutputStream outputStream)
Writes the representation to a byte stream.
|
void |
write(java.nio.channels.WritableByteChannel writableChannel)
Writes the representation to a byte channel.
|
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getReader, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient, writegetModificationDate, getTag, setModificationDate, setTagcreateClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toStringpublic CharacterRepresentation(MediaType mediaType)
mediaType - The media type.public java.nio.channels.ReadableByteChannel getChannel()
throws java.io.IOException
RepresentationgetChannel in class Representationjava.io.IOExceptionpublic java.io.InputStream getStream()
throws java.io.IOException
RepresentationgetStream in class Representationjava.io.IOExceptionpublic void write(java.io.OutputStream outputStream)
throws java.io.IOException
RepresentationOutputStream after writing to it as this will be handled by
the Restlet connectors automatically.write in class RepresentationoutputStream - The output stream.java.io.IOExceptionpublic void write(java.nio.channels.WritableByteChannel writableChannel)
throws java.io.IOException
Representationwrite in class RepresentationwritableChannel - A writable byte channel.java.io.IOExceptionCopyright © 2005-2014 Restlet.