getChannel(Representation representation) Returns a readable byte channel based on the given representation's
content and its write(WritableByteChannel) method.
getStream(ReadableByteChannel readableChannel) Returns an input stream based on a given readable byte channel.
Parameters: readableChannel - The readable byte channel.
getStream(WritableByteChannel writableChannel) Returns an output stream based on a given writable byte channel.
Parameters: writableChannel - The writable byte channel.
toString(InputStream inputStream, CharacterSet characterSet) Converts an input stream to a string using the specified character set
for decoding the input stream.
Returns a readable byte channel based on a given inputstream. If it is
supported by a file a read-only instance of FileChannel is returned.
Parameters: inputStream - The input stream to convert. A readable byte channel.
Returns a readable byte channel based on the given representation's
content and its write(WritableByteChannel) method. Internally, it uses a
writer thread and a pipe stream.
A readable byte channel.
Returns an input stream based on a given readable byte channel.
Parameters: readableChannel - The readable byte channel. An input stream based on a given readable byte channel.
Returns an input stream based on the given representation's content and
its write(OutputStream) method. Internally, it uses a writer thread and a
pipe stream.
A stream with the representation's content.
Returns an output stream based on a given writable byte channel.
Parameters: writableChannel - The writable byte channel. An output stream based on a given writable byte channel.
Converts an input stream to a string. As this method uses the
InputstreamReader class, the default character set is used for decoding
the input stream.
See Also:InputStreamReader
* class See Also:ByteUtils.toString(InputStream,CharacterSet) Parameters: inputStream - The input stream. The converted string.
Converts an input stream to a string using the specified character set
for decoding the input stream.
See Also:InputStreamReader
* class Parameters: inputStream - The input stream. Parameters: characterSet - The character set The converted string.
Writes an input stream to an output stream. When the reading is done, the
input stream is closed.
Parameters: inputStream - The input stream. Parameters: outputStream - The output stream. throws: IOException -
Writes a readable channel to a writable channel. It assumes that the
readable and writable channels are both in NIO blocking mode.
Parameters: readableChannel - The readable channel. Parameters: writableChannel - The writable channel. throws: IOException -