This class defines static methods that support the interoperation of the stream classes of the java.io
package with the channel classes of this package.
Constructs a channel that reads bytes from the given stream.
Constructs a channel that writes bytes to the given stream.
Constructs a stream that reads bytes from the given channel.
Constructs a stream that reads bytes from the given channel.
Constructs a stream that writes bytes to the given channel.
Constructs a stream that writes bytes to the given channel.
Constructs a reader that decodes bytes from the given channel according to the named charset.
Constructs a reader that decodes bytes from the given channel according to the given charset.
Constructs a reader that decodes bytes from the given channel using the given decoder.
Constructs a writer that encodes characters according to the named charset and writes the resulting bytes to the given channel.
Constructs a writer that encodes characters according to the given charset and writes the resulting bytes to the given channel.
Constructs a writer that encodes characters using the given encoder and writes the resulting bytes to the given channel.
Methods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
The read
methods of the resulting stream will throw an IllegalBlockingModeException
if invoked while the underlying channel is in non-blocking mode. The stream will not be buffered, and it will not support the mark
or reset
methods. The stream will be safe for access by multiple concurrent threads. Closing the stream will in turn cause the channel to be closed.
ch
- The channel from which bytes will be read
The write
methods of the resulting stream will throw an IllegalBlockingModeException
if invoked while the underlying channel is in non-blocking mode. The stream will not be buffered. The stream will be safe for access by multiple concurrent threads. Closing the stream will in turn cause the channel to be closed.
ch
- The channel to which bytes will be written
The stream will not be buffered, and it will not support the mark
or reset
methods. The stream will be safe for access by multiple concurrent threads. Closing the stream will in turn cause the channel to be closed.
ch
- The channel from which bytes will be read
The stream will not be buffered. The stream will be safe for access by multiple concurrent threads. Closing the stream will in turn cause the channel to be closed.
ch
- The channel to which bytes will be written
The resulting channel will not be buffered; it will simply redirect its I/O operations to the given stream. Closing the channel will in turn cause the stream to be closed.
in
- The stream from which bytes are to be read
The resulting channel will not be buffered; it will simply redirect its I/O operations to the given stream. Closing the channel will in turn cause the stream to be closed.
out
- The stream to which bytes are to be written
The resulting stream will contain an internal input buffer of at least minBufferCap
bytes. The stream's read
methods will, as needed, fill the buffer by reading bytes from the underlying channel; if the channel is in non-blocking mode when bytes are to be read then an IllegalBlockingModeException
will be thrown. The resulting stream will not otherwise be buffered, and it will not support the mark
or reset
methods. Closing the stream will in turn cause the channel to be closed.
ch
- The channel from which bytes will be read
dec
- The charset decoder to be used
minBufferCap
- The minimum capacity of the internal byte buffer, or -1
if an implementation-dependent default capacity is to be used
Constructs a reader that decodes bytes from the given channel according to the named charset.
An invocation of this method of the form
Channels.newReader(ch, csname)
behaves in exactly the same way as the expression
Channels.newReader(ch, Charset.forName(csName))
ch
- The channel from which bytes will be read
csName
- The name of the charset to be used
UnsupportedCharsetException
- If no support for the named charset is available in this instance of the Java virtual machine
Constructs a reader that decodes bytes from the given channel according to the given charset.
An invocation of this method of the form
Channels.newReader(ch, charset)
behaves in exactly the same way as the expression
Channels.newReader(ch, Charset.forName(csName).newDecoder(), -1)
The reader's default action for malformed-input and unmappable-character errors is to report them. When more control over the error handling is required, the constructor that takes a CharsetDecoder should be used.
ch
- The channel from which bytes will be read
charset
- The charset to be used
The resulting stream will contain an internal output buffer of at least minBufferCap
bytes. The stream's write
methods will, as needed, flush the buffer by writing bytes to the underlying channel; if the channel is in non-blocking mode when bytes are to be written then an IllegalBlockingModeException
will be thrown. The resulting stream will not otherwise be buffered. Closing the stream will in turn cause the channel to be closed.
ch
- The channel to which bytes will be written
enc
- The charset encoder to be used
minBufferCap
- The minimum capacity of the internal byte buffer, or -1
if an implementation-dependent default capacity is to be used
Constructs a writer that encodes characters according to the named charset and writes the resulting bytes to the given channel.
An invocation of this method of the form
Channels.newWriter(ch, csname)
behaves in exactly the same way as the expression
Channels.newWriter(ch, Charset.forName(csName))
ch
- The channel to which bytes will be written
csName
- The name of the charset to be used
UnsupportedCharsetException
- If no support for the named charset is available in this instance of the Java virtual machine
Constructs a writer that encodes characters according to the given charset and writes the resulting bytes to the given channel.
An invocation of this method of the form
Channels.newWriter(ch, charset)
behaves in exactly the same way as the expression
Channels.newWriter(ch, Charset.forName(csName).newEncoder(), -1)
The writer's default action for malformed-input and unmappable-character errors is to report them. When more control over the error handling is required, the constructor that takes a CharsetEncoder should be used.
ch
- The channel to which bytes will be written
charset
- The charset to be used
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4