private class Pipe.RefByteChannel
extends java.lang.Object
implements java.nio.channels.ByteChannel
| Modifier and Type | Field and Description |
|---|---|
private java.nio.channels.Channel |
channel |
private java.util.concurrent.atomic.AtomicBoolean |
closed |
private java.util.concurrent.atomic.AtomicInteger |
references |
| Constructor and Description |
|---|
RefByteChannel(java.nio.channels.Channel channel,
java.util.concurrent.atomic.AtomicInteger references) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
private void |
ensureOpen() |
boolean |
isOpen() |
int |
read(java.nio.ByteBuffer dst) |
int |
write(java.nio.ByteBuffer src) |
private final java.nio.channels.Channel channel
private final java.util.concurrent.atomic.AtomicInteger references
private final java.util.concurrent.atomic.AtomicBoolean closed
public RefByteChannel(java.nio.channels.Channel channel,
java.util.concurrent.atomic.AtomicInteger references)
public int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChanneljava.io.IOExceptionpublic int write(java.nio.ByteBuffer src)
throws java.io.IOException
write in interface java.nio.channels.WritableByteChanneljava.io.IOExceptionpublic boolean isOpen()
isOpen in interface java.nio.channels.Channelprivate void ensureOpen()
throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channeljava.io.IOException