|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.nio.channels.Channels
public final class Channels
This class provides several utilities to get I/O streams from channels.
| Method Summary | |
|---|---|
static ReadableByteChannel |
newChannel(InputStream inputStream)
Returns a channel on the given input stream |
static WritableByteChannel |
newChannel(OutputStream outputStream)
Returns a channel on the given output stream |
static InputStream |
newInputStream(ReadableByteChannel channel)
Returns an input stream on the given channel |
static OutputStream |
newOutputStream(WritableByteChannel channel)
Returns an output stream on the given channel |
static Reader |
newReader(ReadableByteChannel channel,
CharsetDecoder decoder,
int minBufferCapacity)
Returns a reader that decodes bytes from a channel. |
static Reader |
newReader(ReadableByteChannel channel,
String charsetName)
Returns a reader that decodes bytes from a channel. |
static Writer |
newWriter(WritableByteChannel channel,
CharsetEncoder encoder,
int minBufferCapacity)
Returns a writer that encodes characters by encoder and output bytes to a channel. |
static Writer |
newWriter(WritableByteChannel channel,
String charsetName)
Returns a writer that encodes characters by encoder and output bytes to a channel. |
(package private) static ByteBuffer |
wrapByteBuffer(byte[] bytes,
int offset,
int length)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static InputStream newInputStream(ReadableByteChannel channel)
channel - The channel to be wrapped in an InputStream.
public static OutputStream newOutputStream(WritableByteChannel channel)
channel - the channel to be wrapped in an OutputStream.
public static ReadableByteChannel newChannel(InputStream inputStream)
inputStream - the stream to be wrapped in a byte channel.
public static WritableByteChannel newChannel(OutputStream outputStream)
outputStream - the stream to be wrapped in a byte channel.
public static Reader newReader(ReadableByteChannel channel,
CharsetDecoder decoder,
int minBufferCapacity)
channel - Channel to be read.decoder - Charset decoder to be used.minBufferCapacity - The minimum size of byte buffer, -1 means to use default size.
public static Reader newReader(ReadableByteChannel channel,
String charsetName)
channel - Channel to be read.charsetName - Name of charset.
public static Writer newWriter(WritableByteChannel channel,
CharsetEncoder encoder,
int minBufferCapacity)
channel - Channel to be written.encoder - Charset decoder to be used.minBufferCapacity - The minimum size of byte buffer, -1 means to use default size.
public static Writer newWriter(WritableByteChannel channel,
String charsetName)
channel - Channel to be written.charsetName - Name of charset.
static ByteBuffer wrapByteBuffer(byte[] bytes,
int offset,
int length)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||