public class BufferFromInputStream.ByteArrayChannel extends ReadableByteChannelBase implements SeekableByteChannel, Seekable
| Modifier and Type | Field and Description |
|---|---|
protected BufferFromInputStream.BucketPointer |
pointer |
protected long |
pos |
isOpen, maxReadSize| Constructor and Description |
|---|
ByteArrayChannel(long pos,
BufferFromInputStream.BucketPointer pointer) |
| Modifier and Type | Method and Description |
|---|---|
int |
checkNext(int len,
boolean changePos)
Attempt to advance the position by the given number of bytes.
|
int |
checkPrev(int len,
boolean changePos)
The method assumes that the current position is in the valid range
|
Seekable |
clone() |
byte |
get()
Read a byte at the current position
|
long |
getPos()
Optional operation.
|
boolean |
isPosAfterEnd()
The state of a seekable may be one unit beyond the end.
|
boolean |
isPosBeforeStart()
The state of a seekable may be one unit before the start.
|
long |
position() |
BufferFromInputStream.ByteArrayChannel |
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
See
ReadableByteChannel |
void |
posToEnd()
Optional operation.
|
void |
posToStart()
Optional operation.
|
boolean |
prevPos(int len)
Attempt to step back the position by the given number of bytes.
|
int |
readActual(ByteBuffer dst) |
String |
readString(int len) |
void |
setPos(long pos)
Optional operation.
|
long |
size() |
SeekableByteChannel |
truncate(long size) |
int |
write(ByteBuffer src) |
close, isOpen, isUnderlyingEntityKnownToBeClosed, readequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadbinarySearch, cloneObject, close, compareArrays, compareToPrefix, deltaPos, get, nextPos, peekNextBytes, posToNext, posToNext, posToPrev, readprotected long pos
protected BufferFromInputStream.BucketPointer pointer
public ByteArrayChannel(long pos,
BufferFromInputStream.BucketPointer pointer)
public BufferFromInputStream.ByteArrayChannel position(long pos)
ReadableByteChannelposition in interface SeekableByteChannelpos - public long position()
position in interface SeekableByteChannelpublic int readActual(ByteBuffer dst) throws IOException
readActual in class ReadableByteChannelBaseIOExceptionpublic int write(ByteBuffer src) throws IOException
write in interface SeekableByteChannelwrite in interface WritableByteChannelIOExceptionpublic long size()
throws IOException
size in interface SeekableByteChannelsize in interface SeekableIOExceptionpublic SeekableByteChannel truncate(long size) throws IOException
truncate in interface SeekableByteChannelIOExceptionpublic Seekable clone()
public long getPos()
throws IOException
SeekablegetPos in interface SeekableIOExceptionpublic void setPos(long pos)
throws IOException
SeekablesetPos in interface SeekableIOExceptionpublic void posToStart()
throws IOException
SeekableposToStart in interface SeekableIOExceptionpublic void posToEnd()
throws IOException
SeekableposToEnd in interface SeekableIOExceptionpublic boolean isPosBeforeStart()
throws IOException
SeekableisPosBeforeStart in interface SeekableIOExceptionpublic boolean isPosAfterEnd()
throws IOException
SeekableisPosAfterEnd in interface SeekableIOExceptionpublic boolean prevPos(int len)
throws IOException
SeekableprevPos in interface SeekableIOExceptionpublic String readString(int len) throws IOException
readString in interface SeekableIOExceptionpublic int checkNext(int len,
boolean changePos)
throws IOException
SeekablecheckNext in interface SeekableIOExceptionpublic byte get()
throws IOException
Seekableget in interface SeekableIOExceptionpublic int checkPrev(int len,
boolean changePos)
throws IOException
checkPrev in interface SeekableIOExceptionCopyright © 2020. All rights reserved.