org.entityfs.support.io
Class WritableByteBufferChannel
java.lang.Object
org.entityfs.support.io.WritableByteBufferChannel
- All Implemented Interfaces:
- Closeable, Channel, WritableByteChannel
public class WritableByteBufferChannel
- extends Object
- implements WritableByteChannel
This is a WritableByteChannel
that writes its data to a pre-allocated
ByteBuffer
. It assumes exclusive access to the buffer.
Writing operations will update the supplied buffer's internal position.
- Since:
- 1.0
- Author:
- Karl Gustafsson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WritableByteBufferChannel
public WritableByteBufferChannel(ByteBuffer buffer,
int tempBufferSize)
throws IllegalArgumentException
- Throws:
IllegalArgumentException
WritableByteBufferChannel
public WritableByteBufferChannel(ByteBuffer buffer)
write
public int write(ByteBuffer src)
throws IOException
- Specified by:
write
in interface WritableByteChannel
- Throws:
IOException
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interface Channel
close
public void close()
- Specified by:
close
in interface Closeable
- Specified by:
close
in interface Channel