org.restlet.resource
Class StreamRepresentation
java.lang.Object
org.restlet.resource.Variant
org.restlet.resource.Representation
org.restlet.resource.StreamRepresentation
- Direct Known Subclasses:
- InputRepresentation, OutputRepresentation, StringRepresentation
public abstract class StreamRepresentation
- extends Representation
Representation based on a BIO stream.
- 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 |
StreamRepresentation
public StreamRepresentation(MediaType mediaType)
- Constructor.
- Parameters:
mediaType
- The media type.
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 Consulting.