Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.nio.channels

Class Channels

java.lang.Object
|
+--java.nio.channels.Channels


public final class Channels

extends Object

Since:

Method Summary

static java.nio.channels.ReadableByteChannelnewChannel(java.io.InputStream in)

Constructs a channel that reads bytes from the given stream.
static java.nio.channels.WritableByteChannelnewChannel(java.io.OutputStream out)

Constructs a channel that writes bytes to the given stream.
static java.io.InputStreamnewInputStream(java.nio.channels.ReadableByteChannel ch)

Constructs a stream that reads bytes from the given channel.
static java.io.OutputStreamnewOutputStream(java.nio.channels.WritableByteChannel ch)

Constructs a stream that writes bytes to the given channel.
static java.io.ReadernewReader(java.nio.channels.ReadableByteChannel ch, java.nio.charset.CharsetDecoder dec, int minBufferCap)

Constructs a reader that decodes bytes from the given channel using the given decoder.
static java.io.ReadernewReader(java.nio.channels.ReadableByteChannel ch, java.lang.String csName)

Constructs a reader that decodes bytes from the given channel according to the named charset.
static java.io.WriternewWriter(java.nio.channels.WritableByteChannel ch, java.nio.charset.CharsetEncoder enc, int minBufferCap)

Constructs a writer that encodes characters using the given encoder and writes the resulting bytes to the given channel.
static java.io.WriternewWriter(java.nio.channels.WritableByteChannel ch, java.lang.String csName)

Constructs a writer that encodes characters according to the named charset and writes the resulting bytes to the given channel.

Method Details

newChannel

public static ReadableByteChannel newChannel(java.io.InputStream in)

Constructs a channel that reads bytes from the given stream.

Parameters:


newChannel

public static WritableByteChannel newChannel(java.io.OutputStream out)

Constructs a channel that writes bytes to the given stream.

Parameters:


newInputStream

public static InputStream newInputStream(java.nio.channels.ReadableByteChannel ch)

Constructs a stream that reads bytes from the given channel.

Parameters:


newOutputStream

public static OutputStream newOutputStream(java.nio.channels.WritableByteChannel ch)

Constructs a stream that writes bytes to the given channel.

Parameters:


newReader

public static Reader newReader(java.nio.channels.ReadableByteChannel ch, java.lang.String csName)

Constructs a reader that decodes bytes from the given channel according to the named charset.

Parameters:

Throws:


newReader

public static Reader newReader(java.nio.channels.ReadableByteChannel ch, java.nio.charset.CharsetDecoder dec, int minBufferCap)

Constructs a reader that decodes bytes from the given channel using the given decoder.

Parameters:


newWriter

public static Writer newWriter(java.nio.channels.WritableByteChannel ch, java.lang.String csName)

Constructs a writer that encodes characters according to the named charset and writes the resulting bytes to the given channel.

Parameters:

Throws:


newWriter

public static Writer newWriter(java.nio.channels.WritableByteChannel ch, java.nio.charset.CharsetEncoder enc, int minBufferCap)

Constructs a writer that encodes characters using the given encoder and writes the resulting bytes to the given channel.

Parameters: