org.restlet.resource
Class ReadableRepresentation
java.lang.Object
org.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.ChannelRepresentation
org.restlet.resource.ReadableRepresentation
public class ReadableRepresentation
- extends ChannelRepresentation
Transient representation based on a readable NIO byte channel.
- Author:
- Jerome Louvel (contact@noelios.com)
Methods inherited from class org.restlet.resource.Variant |
getCharacterSet, getEncodings, getExpirationDate, getIdentifier, getLanguages, getMediaType, getModificationDate, getSize, getTag, setCharacterSet, setExpirationDate, setIdentifier, setIdentifier, setMediaType, setModificationDate, setSize, setTag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReadableRepresentation
public ReadableRepresentation(ReadableByteChannel readableChannel,
MediaType mediaType)
- Constructor.
- Parameters:
readableChannel
- The representation's channel.mediaType
- The representation's media type.
ReadableRepresentation
public ReadableRepresentation(ReadableByteChannel readableChannel,
MediaType mediaType,
long expectedSize)
- Constructor.
- Parameters:
readableChannel
- The representation's channel.mediaType
- The representation's media type.expectedSize
- The expected stream size.
getChannel
public ReadableByteChannel getChannel()
throws IOException
- Returns a readable byte channel. If it is supported by a file a read-only
instance of FileChannel is returned.
- Specified by:
getChannel
in class Representation
- Returns:
- A readable byte channel.
- Throws:
IOException
write
public void write(WritableByteChannel writableChannel)
throws IOException
- Writes the representation to a byte channel.
- Specified by:
write
in class Representation
- Parameters:
writableChannel
- A writable byte channel.
- Throws:
IOException
Copyright © 2005-2007 Noelios Technologies.