|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.representation.Variant
org.restlet.representation.RepresentationInfo
org.restlet.representation.Representation
org.restlet.representation.StreamRepresentation
org.restlet.representation.InputRepresentation
public class InputRepresentation
Transient representation based on a BIO input stream.
Field Summary |
---|
Fields inherited from class org.restlet.representation.Representation |
---|
UNKNOWN_SIZE |
Constructor Summary | |
---|---|
InputRepresentation(InputStream inputStream)
Constructor. |
|
InputRepresentation(InputStream inputStream,
MediaType mediaType)
Constructor. |
|
InputRepresentation(InputStream inputStream,
MediaType mediaType,
long expectedSize)
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class org.restlet.representation.StreamRepresentation |
---|
getChannel, getReader, write, write |
Methods inherited from class org.restlet.representation.Representation |
---|
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient |
Methods inherited from class org.restlet.representation.RepresentationInfo |
---|
getModificationDate, getTag, setModificationDate, setTag |
Methods inherited from class org.restlet.representation.Variant |
---|
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public 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.Method Detail |
---|
public InputStream getStream() throws IOException
Representation
getStream
in class Representation
IOException
public String getText() throws IOException
getStream()
. This stream is
closed once fully read.
getText
in class Representation
IOException
public void release()
release
in class Representation
public void setStream(InputStream stream)
stream
- The input stream to use.public void write(OutputStream outputStream) throws IOException
Representation
OutputStream
after writing to it as this will be handled by
the Restlet connectors automatically.
write
in class Representation
outputStream
- The output stream.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |