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.ReadableByteChannel
java.io.IOException
public int write(java.nio.ByteBuffer src) throws java.io.IOException
write
in interface java.nio.channels.WritableByteChannel
java.io.IOException
public boolean isOpen()
isOpen
in interface java.nio.channels.Channel
private void ensureOpen() throws java.nio.channels.ClosedChannelException
java.nio.channels.ClosedChannelException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface java.nio.channels.Channel
java.io.IOException