# ByteChannel

public interface **ByteChannel** implements [ReadableByteChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ReadableByteChannel.html) [WritableByteChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/WritableByteChannel.html)

|---|---|---|
| Known Indirect Subclasses [DatagramChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/DatagramChannel.html), [FileChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/FileChannel.html), [SeekableByteChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SeekableByteChannel.html), [SocketChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SocketChannel.html) |---|---| | [DatagramChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/DatagramChannel.html) | A selectable channel for datagram-oriented sockets. | | [FileChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/FileChannel.html) | A channel for reading, writing, mapping, and manipulating a file. | | [SeekableByteChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SeekableByteChannel.html) | A byte channel that maintains a current *position* and allows the position to be changed. | | [SocketChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/SocketChannel.html) | A selectable channel for stream-oriented connecting sockets. | |||

A channel that can read and write bytes. This interface simply unifies
`https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ReadableByteChannel.html` and `https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/WritableByteChannel.html`; it does not
specify any new operations.

### Inherited Method Summary

From interface [java.nio.channels.ReadableByteChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ReadableByteChannel.html)

|---|---|
| abstract int | [read](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/ReadableByteChannel.html#read(java.nio.ByteBuffer))([ByteBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html) dst) Reads a sequence of bytes from this channel into the given buffer. |

From interface [java.nio.channels.WritableByteChannel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/WritableByteChannel.html)

|---|---|
| abstract int | [write](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/WritableByteChannel.html#write(java.nio.ByteBuffer))([ByteBuffer](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/ByteBuffer.html) src) Writes a sequence of bytes to this channel from the given buffer. |

From interface [java.nio.channels.Channel](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/Channel.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/Channel.html#close())() Closes this channel. |
| abstract boolean | [isOpen](https://developers.google.com/j2objc/javadoc/jre/reference/java/nio/channels/Channel.html#isOpen())() Tells whether or not this channel is open. |

From interface [java.io.Closeable](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Closeable.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/Closeable.html#close())() Closes this stream and releases any system resources associated with it. |

From interface [java.lang.AutoCloseable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AutoCloseable.html)

|---|---|
| abstract void | [close](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/AutoCloseable.html#close())() Closes this resource, relinquishing any underlying resources. |