File slice.
| Modifier and Type | Field and Description |
|---|---|
| private ByteBuffer | backingByteBuffer
The backing byte buffer, if any. |
| public final File | |
| private FileChannel | fileChannel
The file channel. |
| private final long | fileLength
The file length. |
| private final AtomicBoolean | |
| private final boolean | isTopLevelFileSlice
True if this is a top level file slice. |
| public RandomAccessFile | raf
The |
| Access | Constructor and Description |
|---|---|
| private | FileSlice(final FileSlice
the parent slice parentSlice, final long the offset of the sub-slice within the parent slice offset, final long the length of the sub-slice length, final boolean true if this is a deflated zip entry isDeflatedZipEntry, final long the uncompressed size of a deflated zip entry, or -1 if unknown, or 0 of this is not a deflated
zip entry. inflatedLengthHint, final NestedJarHandler the nested jar handler nestedJarHandler)Constructor for treating a range of a file as a slice. |
| public | FileSlice(final File
the file file, final boolean true if this is a deflated zip entry isDeflatedZipEntry, final long the uncompressed size of a deflated zip entry, or -1 if unknown, or 0 of this is not a deflated
zip entry. inflatedLengthHint, final NestedJarHandler the nested jar handler nestedJarHandler, final LogNode the log log)Constructor for toplevel file slice. |
| public | FileSlice(final File
the file file, final NestedJarHandler the nested jar handler nestedJarHandler, final LogNode the log log)Constructor for toplevel file slice. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides nonapi. Implements java. Close the slice. |
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides nonapi. Indicates whether some other object is "equal to" this one. |
| public int | hashCode()
Overrides nonapi. Returns a hash code value for this object. |
| public byte[] | Returns: the byte[]Implements abstract nonapi. Load the slice as a byte array. |
| public RandomAccessReader | Returns: the random access readerImplements abstract nonapi. Read directly from FileChannel (slow path, but handles >2GB). |
| public ByteBuffer | Returns: the byte bufferOverrides nonapi. Read the slice into a |
| public Slice | Returns: the slicethe offset of the sub-slice within the parent slice offset, final long the length of the sub-slice length, final boolean true if this is a deflated zip entry isDeflatedZipEntry, final long the uncompressed size of a deflated zip entry, or -1 if unknown, or 0 of this is not a deflated
zip entry. inflatedLengthHint)Implements abstract nonapi. Slice the file. |
| backingByteBuffer | back to summary |
|---|---|
| private ByteBuffer backingByteBuffer The backing byte buffer, if any. | |
| file | back to summary |
|---|---|
| public final File file The | |
| fileChannel | back to summary |
|---|---|
| private FileChannel fileChannel The file channel. | |
| fileLength | back to summary |
|---|---|
| private final long fileLength The file length. | |
| isClosed | back to summary |
|---|---|
| private final AtomicBoolean isClosed True if | |
| isTopLevelFileSlice | back to summary |
|---|---|
| private final boolean isTopLevelFileSlice True if this is a top level file slice. | |
| raf | back to summary |
|---|---|
| public RandomAccessFile raf The | |
| FileSlice | back to summary |
|---|---|
| private FileSlice(final FileSlice parentSlice, final long offset, final long length, final boolean isDeflatedZipEntry, final long inflatedLengthHint, final NestedJarHandler nestedJarHandler) Constructor for treating a range of a file as a slice.
| |
| FileSlice | back to summary |
|---|---|
| public FileSlice(final File file, final boolean isDeflatedZipEntry, final long inflatedLengthHint, final NestedJarHandler nestedJarHandler, final LogNode log) throws IOException Constructor for toplevel file slice.
| |
| FileSlice | back to summary |
|---|---|
| public FileSlice(final File file, final NestedJarHandler nestedJarHandler, final LogNode log) throws IOException Constructor for toplevel file slice.
| |
| close | back to summary |
|---|---|
| public void close() Overrides nonapi. Implements java. Close the slice. Unmaps any backing
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides nonapi. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides nonapi. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| load | back to summary |
|---|---|
| public byte[] load() throws IOException Implements abstract nonapi. Load the slice as a byte array.
| |
| randomAccessReader | back to summary |
|---|---|
| public RandomAccessReader randomAccessReader() Implements abstract nonapi. Read directly from FileChannel (slow path, but handles >2GB).
| |
| read | back to summary |
|---|---|
| public ByteBuffer read() throws IOException Overrides nonapi. Read the slice into a
| |
| slice | back to summary |
|---|---|
| public Slice slice(final long offset, final long length, final boolean isDeflatedZipEntry, final long inflatedLengthHint) Implements abstract nonapi. Slice the file.
| |