public class CountingReadableByteChannel
extends java.lang.Object
implements java.nio.channels.ReadableByteChannel
Constructor and Description |
---|
CountingReadableByteChannel(java.nio.channels.ReadableByteChannel delegate,
java.util.function.Consumer<java.lang.Integer> bytesReadConsumer) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static CountingReadableByteChannel |
createWithNoOpConsumer(java.nio.channels.ReadableByteChannel delegate) |
boolean |
isOpen() |
int |
read(java.nio.ByteBuffer dst) |
public CountingReadableByteChannel(java.nio.channels.ReadableByteChannel delegate, java.util.function.Consumer<java.lang.Integer> bytesReadConsumer)
public static CountingReadableByteChannel createWithNoOpConsumer(java.nio.channels.ReadableByteChannel delegate)
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
read
in interface java.nio.channels.ReadableByteChannel
java.io.IOException
public boolean isOpen()
isOpen
in interface java.nio.channels.Channel
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