Class BufferOverInputStream.ByteArrayChannel
java.lang.Object
org.aksw.commons.io.hadoop.binseach.bz2.ReadableByteChannelBase
org.aksw.commons.io.hadoop.binseach.bz2.BufferOverInputStream.ByteArrayChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,SeekableByteChannel,WritableByteChannel,org.aksw.commons.io.seekable.api.Seekable
- Enclosing class:
- BufferOverInputStream
public class BufferOverInputStream.ByteArrayChannel
extends ReadableByteChannelBase
implements SeekableByteChannel, org.aksw.commons.io.seekable.api.Seekable
-
Field Summary
FieldsFields inherited from class org.aksw.commons.io.hadoop.binseach.bz2.ReadableByteChannelBase
isOpen, maxReadSize -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcheckNext(int len, boolean changePos) intcheckPrev(int len, boolean changePos) The method assumes that the current position is in the valid rangeorg.aksw.commons.io.seekable.api.Seekableclone()byteget()longgetPos()booleanbooleanlongloadAll()Loads all data into the buffer and returns the total sizelongposition()position(long pos) Setting a position outside of the size of the entity is valid will will cause a read to immediately return an EOF SeeReadableByteChannelvoidposToEnd()Set the position to the end of the stream immediately loads all data.voidintreadActual(ByteBuffer dst) readString(int len) voidsetPos(long pos) longsize()First checks whether there is at least one more byte available and afterwards returns the currently known sizetruncate(long size) intwrite(ByteBuffer src) Methods inherited from class org.aksw.commons.io.hadoop.binseach.bz2.ReadableByteChannelBase
close, isOpen, isUnderlyingEntityKnownToBeClosed, readMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.commons.io.seekable.api.Seekable
binarySearch, cloneObject, close, compareToPrefix, deltaPos, get, nextPos, peekNextBytes, posToNext, posToNext, posToPrev, prevPos, readMethods inherited from interface java.nio.channels.SeekableByteChannel
read
-
Field Details
-
pos
protected long pos -
pointer
-
-
Constructor Details
-
ByteArrayChannel
-
-
Method Details
-
position
Setting a position outside of the size of the entity is valid will will cause a read to immediately return an EOF SeeReadableByteChannel- Specified by:
positionin interfaceSeekableByteChannel- Parameters:
pos-- Returns:
-
position
public long position()- Specified by:
positionin interfaceSeekableByteChannel
-
readActual
- Specified by:
readActualin classReadableByteChannelBase- Throws:
IOException
-
write
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
size
First checks whether there is at least one more byte available and afterwards returns the currently known size- Specified by:
sizein interfaceorg.aksw.commons.io.seekable.api.Seekable- Specified by:
sizein interfaceSeekableByteChannel- Throws:
IOException
-
loadAll
Loads all data into the buffer and returns the total size- Throws:
IOException
-
truncate
- Specified by:
truncatein interfaceSeekableByteChannel- Throws:
IOException
-
clone
public org.aksw.commons.io.seekable.api.Seekable clone() -
getPos
- Specified by:
getPosin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
setPos
- Specified by:
setPosin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
posToStart
- Specified by:
posToStartin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
posToEnd
Set the position to the end of the stream immediately loads all data.- Specified by:
posToEndin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
isPosBeforeStart
- Specified by:
isPosBeforeStartin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
isPosAfterEnd
- Specified by:
isPosAfterEndin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
readString
- Specified by:
readStringin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
checkNext
- Specified by:
checkNextin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
get
- Specified by:
getin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-
checkPrev
The method assumes that the current position is in the valid range- Specified by:
checkPrevin interfaceorg.aksw.commons.io.seekable.api.Seekable- Throws:
IOException
-