public abstract class WritableRepresentation extends ChannelRepresentation
UNKNOWN_SIZE
Constructor and Description |
---|
WritableRepresentation(MediaType mediaType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.nio.channels.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. |
abstract void |
write(java.nio.channels.WritableByteChannel writableChannel)
Writes the representation to a byte channel.
|
getReader, getStream, write, write
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, 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 WritableRepresentation(MediaType mediaType)
mediaType
- The representation's media type.public java.nio.channels.ReadableByteChannel getChannel() throws java.io.IOException
Representation
getChannel
in class Representation
java.io.IOException
public abstract void write(java.nio.channels.WritableByteChannel writableChannel) throws java.io.IOException
Representation
write
in class Representation
writableChannel
- A writable byte channel.java.io.IOException
Copyright © 2005-2020 Restlet.