public class CountingWritableByteChannel
extends java.lang.Object
implements java.nio.channels.WritableByteChannel
Constructor and Description |
---|
CountingWritableByteChannel(java.nio.channels.WritableByteChannel delegate,
java.util.function.Consumer<java.lang.Integer> bytesWrittenConsumer) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static CountingWritableByteChannel |
createWithNoOpConsumer(java.nio.channels.WritableByteChannel delegate) |
boolean |
isOpen() |
int |
write(java.nio.ByteBuffer src) |
public CountingWritableByteChannel(java.nio.channels.WritableByteChannel delegate, java.util.function.Consumer<java.lang.Integer> bytesWrittenConsumer)
public static CountingWritableByteChannel createWithNoOpConsumer(java.nio.channels.WritableByteChannel delegate)
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
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