Package net.apartium.cocoabeans.seekable
Class ByteArraySeekableChannel
java.lang.Object
net.apartium.cocoabeans.seekable.ByteArraySeekableChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,SeekableByteChannel,WritableByteChannel
@AvailableSince("0.0.46")
public final class ByteArraySeekableChannel
extends Object
implements SeekableByteChannel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanisOpen()static ByteArraySeekableChannelof(byte[] data) longposition()position(long newPos) intread(ByteBuffer dst) longsize()byte[]truncate(long newSize) intwrite(ByteBuffer src)
-
Constructor Details
-
ByteArraySeekableChannel
public ByteArraySeekableChannel(int initialCapacity) -
ByteArraySeekableChannel
public ByteArraySeekableChannel()
-
-
Method Details
-
of
-
read
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Throws:
IOException
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
position
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
size
- Specified by:
sizein interfaceSeekableByteChannel- Throws:
IOException
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
public void close() -
toByteArray
public byte[] toByteArray()
-