java.lang.Object | |
↳ | java.nio.channels.Channels |
This class provides several utilities to get I/O streams from channels.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a readable channel on the given input stream.
| |||||||||||
Returns a writable channel on the given output stream.
| |||||||||||
Returns an input stream on the given channel.
| |||||||||||
Returns an output stream on the given channel.
| |||||||||||
Returns a reader that decodes bytes from a channel.
| |||||||||||
Returns a reader that decodes bytes from a channel.
| |||||||||||
Returns a writer that encodes characters with the specified
encoder and sends the bytes to the specified channel. | |||||||||||
Returns a writer that encodes characters with the specified
encoder and sends the bytes to the specified channel. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Returns a readable channel on the given input stream. The resulting channel has the following properties:
inputStream | the stream to be wrapped by a byte channel. |
---|
Returns a writable channel on the given output stream. The resulting channel has following properties:
outputStream | the stream to be wrapped by a byte channel. |
---|
Returns an input stream on the given channel. The resulting stream has the following properties:
read
is called.mark
nor reset
is supported.channel | the channel to be wrapped by an InputStream. |
---|
Returns an output stream on the given channel. The resulting stream has the following properties:
write
is called.channel | the channel to be wrapped by an OutputStream. |
---|
Returns a reader that decodes bytes from a channel.
channel | the Channel to be read. |
---|---|
decoder | the Charset decoder to be used. |
minBufferCapacity | The minimum size of the byte buffer, -1 means to use the default size. |
Returns a reader that decodes bytes from a channel. This method creates a reader with a buffer of default size.
channel | the Channel to be read. |
---|---|
charsetName | the name of the charset. |
UnsupportedCharsetException | if the given charset name is not supported. |
---|
Returns a writer that encodes characters with the specified
encoder
and sends the bytes to the specified channel. This method
creates a writer with a buffer of default size.
channel | the Channel to be written to. |
---|---|
charsetName | the name of the charset. |
UnsupportedCharsetException | if the given charset name is not supported. |
---|
Returns a writer that encodes characters with the specified
encoder
and sends the bytes to the specified channel.
channel | the Channel to write to. |
---|---|
encoder | the CharsetEncoder to be used. |
minBufferCapacity | the minimum size of the byte buffer, -1 means to use the default size. |