java.nio.channels
public
final
class
java.nio.channels.Channels
This class provides several utilities to get I/O streams from channels.
Summary
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
Returns a channel on the given input stream
Parameters
inputStream
| the stream to be wrapped in a byte channel. |
Returns
- a byte channel that reads bytes from the input stream.
Returns a channel on the given output stream
Parameters
outputStream
| the stream to be wrapped in a byte channel. |
Returns
- a byte channel that writes bytes to the output stream.
Returns an input stream on the given channel
Parameters
channel
| The channel to be wrapped in an InputStream. |
Returns
- an InputStream that takes bytes from the given byte channel.
Returns an output stream on the given channel
Parameters
channel
| the channel to be wrapped in an OutputStream. |
Returns
- an OutputStream that puts bytes onto the given byte channel.
Returns a reader that decodes bytes from a channel.
Parameters
channel
| Channel to be read. |
decoder
| Charset decoder to be used. |
minBufferCapacity
| The minimum size of byte buffer, -1 means to use default size. |
Returns a reader that decodes bytes from a channel.
Parameters
channel
| Channel to be read. |
charsetName
| Name of charset. |
Returns a writer that encodes characters by encoder and output bytes to a
channel.
Parameters
channel
| Channel to be written. |
charsetName
| Name of charset. |
Returns a writer that encodes characters by encoder and output bytes to a
channel.
Parameters
channel
| Channel to be written. |
encoder
| Charset decoder to be used. |
minBufferCapacity
| The minimum size of byte buffer, -1 means to use default size. |