|
||||||||||
| 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.util.WrapperRepresentation
org.restlet.engine.application.RangeRepresentation
public class RangeRepresentation
Representation that exposes only a range of the content of a wrapped representation.
| Field Summary |
|---|
| Fields inherited from class org.restlet.representation.Representation |
|---|
UNKNOWN_SIZE |
| Constructor Summary | |
|---|---|
RangeRepresentation(Representation wrappedRepresentation)
Constructor. |
|
RangeRepresentation(Representation wrappedRepresentation,
Range range)
Constructor. |
|
| Method Summary | |
|---|---|
long |
getAvailableSize()
Returns the size effectively available. |
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. |
Range |
getRange()
Returns the range specific to this wrapper. |
Reader |
getReader()
Returns a characters reader with the representation's content. |
InputStream |
getStream()
Returns a stream with the representation's content. |
String |
getText()
Converts the representation to a string value. |
void |
setRange(Range range)
Sets the range specific to this wrapper. |
void |
write(OutputStream outputStream)
Writes the representation to a byte stream. |
void |
write(WritableByteChannel writableChannel)
Writes the representation to a byte channel. |
void |
write(Writer writer)
Writes the representation to a characters writer. |
| Methods inherited from class org.restlet.util.WrapperRepresentation |
|---|
exhaust, getCharacterSet, getDigest, getDisposition, getEncodings, getExpirationDate, getLanguages, getLocationRef, getMediaType, getModificationDate, getRegistration, getSize, getTag, getWrappedRepresentation, isAvailable, isSelectable, isTransient, release, setAvailable, setCharacterSet, setDigest, setDisposition, setEncodings, setExpirationDate, setLanguages, setLocationRef, setLocationRef, setMediaType, setModificationDate, setSize, setTag, setTransient |
| Methods inherited from class org.restlet.representation.Representation |
|---|
append, hasKnownSize, isEmpty, setListener |
| Methods inherited from class org.restlet.representation.Variant |
|---|
createClientInfo, equals, includes, isCompatible, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RangeRepresentation(Representation wrappedRepresentation)
wrappedRepresentation - The wrapped representation with a complete content.
public RangeRepresentation(Representation wrappedRepresentation,
Range range)
wrappedRepresentation - The wrapped representation with a complete content.range - The range to expose.| Method Detail |
|---|
public long getAvailableSize()
RepresentationRepresentation.getSize() if no range is defined, otherwise it returns the size
of the range using Range.getSize().
getAvailableSize in class WrapperRepresentation
public ReadableByteChannel getChannel()
throws IOException
Representation
getChannel in class WrapperRepresentationIOExceptionpublic Range getRange()
getRange in class WrapperRepresentation
public Reader getReader()
throws IOException
Representation
getReader in class WrapperRepresentationIOException
public InputStream getStream()
throws IOException
Representation
getStream in class WrapperRepresentationIOException
public String getText()
throws IOException
Representation
getText in class WrapperRepresentationIOExceptionpublic void setRange(Range range)
setRange in class WrapperRepresentationrange - The range specific to this wrapper.
public void write(Writer writer)
throws IOException
RepresentationWriter after writing to it as this will be handled
by the Restlet connectors automatically.
write in class WrapperRepresentationwriter - The characters writer.
IOException
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 WrapperRepresentationoutputStream - The output stream.
IOException
public void write(WritableByteChannel writableChannel)
throws IOException
Representation
write in class WrapperRepresentationwritableChannel - A writable byte channel.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||