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 |
---|---|
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.
|
getReader, write, write
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient, write
getModificationDate, getTag, setModificationDate, setTag
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
public 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 java.nio.channels.ReadableByteChannel getChannel() throws java.io.IOException
Representation
getChannel
in class StreamRepresentation
java.io.IOException
public java.io.InputStream getStream() throws java.io.IOException
getStream
in class Representation
java.io.IOException
Copyright © 2005-2020 Restlet.