public abstract class OutputRepresentation extends StreamRepresentation
UNKNOWN_SIZE| Constructor and Description |
|---|
OutputRepresentation(MediaType mediaType)
Constructor.
|
OutputRepresentation(MediaType mediaType,
long expectedSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
InputStream |
getStream()
Returns a stream with the representation's content.
|
getReader, write, writeappend, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, 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 OutputRepresentation(MediaType mediaType)
mediaType - The representation's mediaType.public OutputRepresentation(MediaType mediaType, long expectedSize)
mediaType - The representation's mediaType.expectedSize - The expected input stream size.public ReadableByteChannel getChannel() throws IOException
RepresentationgetChannel in class StreamRepresentationIOExceptionpublic InputStream getStream() throws IOException
getStream in class RepresentationIOExceptionCopyright © 2005-2016 Restlet.