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, 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, 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 ReadableByteChannel getChannel() throws IOException
Representation
getChannel
in class StreamRepresentation
IOException
public InputStream getStream() throws IOException
getStream
in class Representation
IOException
Copyright © 2005–2017. All rights reserved.