public class ReadableRepresentation extends ChannelRepresentation
UNKNOWN_SIZE
Constructor and Description |
---|
ReadableRepresentation(java.nio.channels.ReadableByteChannel readableChannel,
MediaType mediaType)
Constructor.
|
ReadableRepresentation(java.nio.channels.ReadableByteChannel channel,
MediaType mediaType,
long expectedSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.nio.channels.ReadableByteChannel |
getChannel()
Returns a channel with the representation's content.
|
void |
setChannel(java.nio.channels.ReadableByteChannel channel)
Sets the readable channel.
|
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 ReadableRepresentation(java.nio.channels.ReadableByteChannel readableChannel, MediaType mediaType)
readableChannel
- The representation's channel.mediaType
- The representation's media type.public ReadableRepresentation(java.nio.channels.ReadableByteChannel channel, MediaType mediaType, long expectedSize)
channel
- The representation's channel.mediaType
- The representation's media type.expectedSize
- The expected stream size.public java.nio.channels.ReadableByteChannel getChannel() throws java.io.IOException
Representation
getChannel
in class Representation
java.io.IOException
public void setChannel(java.nio.channels.ReadableByteChannel channel)
channel
- The readable channel.public 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-2024 Restlet.