public class InputRepresentation extends StreamRepresentation
UNKNOWN_SIZE| Constructor and Description |
|---|
InputRepresentation(InputStream inputStream)
Constructor.
|
InputRepresentation(InputStream inputStream,
MediaType mediaType)
Constructor.
|
InputRepresentation(InputStream inputStream,
MediaType mediaType,
long expectedSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getStream()
Returns a stream with the representation's content.
|
String |
getText()
Note that this method relies on
getStream(). |
void |
release()
Closes and releases the input stream.
|
void |
setStream(InputStream stream)
Sets the input stream to use.
|
void |
write(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(InputStream inputStream)
inputStream - The representation's stream.public InputRepresentation(InputStream inputStream, MediaType mediaType)
inputStream - The representation's stream.mediaType - The representation's media type.public InputRepresentation(InputStream inputStream, MediaType mediaType, long expectedSize)
inputStream - The representation's stream.mediaType - The representation's media type.expectedSize - The expected input stream size.public InputStream getStream() throws IOException
RepresentationgetStream in class RepresentationIOExceptionpublic String getText() throws IOException
getStream(). This stream is closed
once fully read.getText in class RepresentationIOExceptionpublic void release()
release in class Representationpublic void setStream(InputStream stream)
stream - The input stream to use.public void write(OutputStream outputStream) throws IOException
RepresentationOutputStream after writing to it as this will be handled by the
Restlet connectors automatically.write in class RepresentationoutputStream - The output stream.IOExceptionCopyright © 2005–2025. All rights reserved.