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.
|
getReader
append, exhaust, getAvailableSize, getDisposition, getExpirationDate, getRange, getSize, hasKnownSize, isAvailable, isEmpty, isTransient, setAvailable, setDisposition, setExpirationDate, setRange, setSize, setTransient
getModificationDate, getTag, setModificationDate, setTag
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
public 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
Representation
getStream
in class Representation
java.io.IOException
public java.lang.String getText() throws java.io.IOException
getStream()
. This stream is
closed once fully read.getText
in class Representation
java.io.IOException
public void release()
release
in class Representation
public void setStream(java.io.InputStream stream)
stream
- The input stream to use.Copyright © 2005-2024 Restlet.