RandomAccessReader for a File. Reads in little endian order, as required by the zipfile
format.
| Modifier and Type | Field and Description |
|---|---|
| private final FileChannel | fileChannel
The file channel. |
| private ByteBuffer | reusableByteBuffer
The reusable byte buffer. |
| private final byte[] | scratchArr
The scratch arr. |
| private final ByteBuffer | scratchByteBuf
The scratch byte buf. |
| private final long | sliceLength
The slice length. |
| private final long | sliceStartPos
The slice start pos. |
| private byte[] | utf8Bytes
The utf 8 bytes. |
| Access | Constructor and Description |
|---|---|
| public | RandomAccessFileChannelReader(final FileChannel
the file channel fileChannel, final long the slice start pos sliceStartPos, final long the slice length sliceLength)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public int | read(final long
The offset to start reading from. srcOffset, final ByteBuffer The dstBuf, final int ByteBuffer to write into.The offset within the destination buffer to start writing at. dstBufStart, final int The number of bytes to read. numBytes)Implements nonapi. Read bytes into a |
| public int | read(final long
The offset to start reading from. srcOffset, final byte[] The byte array to write into. dstArr, final int The offset within the destination array to start writing at. dstArrStart, final int The number of bytes to read. numBytes)Implements nonapi. Read bytes into a byte array. |
| public byte | readByte(final long
The buffer offset to read from. offset)Implements nonapi. Read a byte at a specific offset (without changing the current cursor offset). |
| public int | readInt(final long
The buffer offset to read from. offset)Implements nonapi. Read a int at a specific offset (without changing the current cursor offset). |
| public long | readLong(final long
The buffer offset to read from. offset)Implements nonapi. Read a long at a specific offset (without changing the current cursor offset). |
| public short | readShort(final long
The buffer offset to read from. offset)Implements nonapi. Read a short at a specific offset (without changing the current cursor offset). |
| public String | readString(final long
The start offset of the string. offset, final int The number of bytes of the UTF8 encoding of the string. numBytes, final boolean If true, replace '/' with '.'. replaceSlashWithDot, final boolean If true, string final ';' character. stripLSemicolon)Implements nonapi. Reads the "modified UTF8" format defined in the Java classfile spec, optionally replacing '/' with '.', and optionally removing the prefix "L" and the suffix ";". |
| public String | readString(final long
The start offset of the string. offset, final int The number of bytes of the UTF8 encoding of the string. numBytes)Implements nonapi. Reads the "modified UTF8" format defined in the Java classfile spec. |
| public int | readUnsignedByte(final long
The buffer offset to read from. offset)Implements nonapi. Read an unsigned byte at a specific offset (without changing the current cursor offset). |
| public long | readUnsignedInt(final long
The buffer offset to read from. offset)Implements nonapi. Read a unsigned int at a specific offset (without changing the current cursor offset). |
| public int | readUnsignedShort(final long
The buffer offset to read from. offset)Implements nonapi. Read a unsigned short at a specific offset (without changing the current cursor offset). |
| fileChannel | back to summary |
|---|---|
| private final FileChannel fileChannel The file channel. | |
| reusableByteBuffer | back to summary |
|---|---|
| private ByteBuffer reusableByteBuffer The reusable byte buffer. | |
| scratchArr | back to summary |
|---|---|
| private final byte[] scratchArr The scratch arr. | |
| scratchByteBuf | back to summary |
|---|---|
| private final ByteBuffer scratchByteBuf The scratch byte buf. | |
| sliceLength | back to summary |
|---|---|
| private final long sliceLength The slice length. | |
| sliceStartPos | back to summary |
|---|---|
| private final long sliceStartPos The slice start pos. | |
| utf8Bytes | back to summary |
|---|---|
| private byte[] utf8Bytes The utf 8 bytes. | |
| RandomAccessFileChannelReader | back to summary |
|---|---|
| public RandomAccessFileChannelReader(final FileChannel fileChannel, final long sliceStartPos, final long sliceLength) Constructor.
| |
| read | back to summary |
|---|---|
| public int read(final long srcOffset, final ByteBuffer dstBuf, final int dstBufStart, final int numBytes) throws IOException Implements nonapi. Doc from nonapi. Read bytes into a
| |
| read | back to summary |
|---|---|
| public int read(final long srcOffset, final byte[] dstArr, final int dstArrStart, final int numBytes) throws IOException Implements nonapi. Doc from nonapi. Read bytes into a byte array.
| |
| readByte | back to summary |
|---|---|
| public byte readByte(final long offset) throws IOException Implements nonapi. Doc from nonapi. Read a byte at a specific offset (without changing the current cursor offset).
| |
| readInt | back to summary |
|---|---|
| public int readInt(final long offset) throws IOException Implements nonapi. Doc from nonapi. Read a int at a specific offset (without changing the current cursor offset).
| |
| readLong | back to summary |
|---|---|
| public long readLong(final long offset) throws IOException Implements nonapi. Doc from nonapi. Read a long at a specific offset (without changing the current cursor offset).
| |
| readShort | back to summary |
|---|---|
| public short readShort(final long offset) throws IOException Implements nonapi. Doc from nonapi. Read a short at a specific offset (without changing the current cursor offset).
| |
| readString | back to summary |
|---|---|
| public String readString(final long offset, final int numBytes, final boolean replaceSlashWithDot, final boolean stripLSemicolon) throws IOException Implements nonapi. Doc from nonapi. Reads the "modified UTF8" format defined in the Java classfile spec, optionally replacing '/' with '.', and optionally removing the prefix "L" and the suffix ";".
| |
| readString | back to summary |
|---|---|
| public String readString(final long offset, final int numBytes) throws IOException Implements nonapi. Doc from nonapi. Reads the "modified UTF8" format defined in the Java classfile spec.
| |
| readUnsignedByte | back to summary |
|---|---|
| public int readUnsignedByte(final long offset) throws IOException Implements nonapi. Doc from nonapi. Read an unsigned byte at a specific offset (without changing the current cursor offset).
| |
| readUnsignedInt | back to summary |
|---|---|
| public long readUnsignedInt(final long offset) throws IOException Implements nonapi. Doc from nonapi. Read a unsigned int at a specific offset (without changing the current cursor offset).
| |
| readUnsignedShort | back to summary |
|---|---|
| public int readUnsignedShort(final long offset) throws IOException Implements nonapi. Doc from nonapi. Read a unsigned short at a specific offset (without changing the current cursor offset).
| |