public class InputRepresentation extends StreamRepresentation
UNKNOWN_SIZE| Constructor and Description |
|---|
InputRepresentation(java.io.InputStream inputStream)
Constructor.
|
InputRepresentation(java.io.InputStream inputStream,
MediaType mediaType)
Constructor.
|
InputRepresentation(java.io.InputStream inputStream,
MediaType mediaType,
long expectedSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
getStream()
Returns a stream with the representation's content.
|
java.lang.String |
getText()
Note that this method relies on
getStream(). |
void |
release()
Closes and releases the input stream.
|
void |
setStream(java.io.InputStream stream)
Sets the input stream to use.
|
void |
write(java.io.OutputStream outputStream)
Writes the representation to a byte stream.
|
getChannel, getReader, write, writeappend, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransientgetModificationDate, getTag, setModificationDate, setTagcreateClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toStringpublic InputRepresentation(java.io.InputStream inputStream)
inputStream - The representation's stream.public InputRepresentation(java.io.InputStream inputStream,
MediaType mediaType)
inputStream - The representation's stream.mediaType - The representation's media type.public InputRepresentation(java.io.InputStream inputStream,
MediaType mediaType,
long expectedSize)
inputStream - The representation's stream.mediaType - The representation's media type.expectedSize - The expected input stream size.public java.io.InputStream getStream()
throws java.io.IOException
RepresentationgetStream in class Representationjava.io.IOExceptionpublic java.lang.String getText()
throws java.io.IOException
getStream(). This stream is
closed once fully read.getText in class Representationjava.io.IOExceptionpublic void release()
release in class Representationpublic void setStream(java.io.InputStream stream)
stream - The input stream to use.public 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.IOExceptionCopyright © 2005-2024 Restlet.