File, ByteBuffer or InputStream. A single Slice instance should only
be used by a single thread.
| Modifier and Type | Field and Description |
|---|---|
| private int | hashCode
The cached hashCode. |
| public final long | inflatedLengthHint
If the slice is a deflated zip entry, this is the expected uncompressed length, or -1L if unknown. |
| public final boolean | isDeflatedZipEntry
If true, the slice is a deflated zip entry, and needs to be inflated to access the content. |
| protected final NestedJarHandler | |
| protected final Slice | parentSlice
The parent slice. |
| public long | sliceLength
The length of the slice, or -1L if unknown (for |
| public final long | sliceStartPos
The start position of the slice. |
| Access | Constructor and Description |
|---|---|
| protected | Slice(final Slice
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 slice as a sub-slice. |
| protected | Slice(final long
the length 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. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| public boolean | equals(final Object
the reference object with which to compare. o)Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public abstract byte[] | |
| public String | |
| public InputStream | |
| public InputStream | Returns: the input streamthe resourceToClose)Resource to close when the returned InputStream is closed, or null if none.Open this |
| public abstract RandomAccessReader | Returns: the random access readerCreate a new |
| public ByteBuffer | |
| public abstract Slice | Returns: The child slice.The offset to start slicing from, relative to this parent slice's start position. offset, long The length of the slice. length, 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) |
| hashCode | back to summary |
|---|---|
| private int hashCode The cached hashCode. | |
| inflatedLengthHint | back to summary |
|---|---|
| public final long inflatedLengthHint If the slice is a deflated zip entry, this is the expected uncompressed length, or -1L if unknown. | |
| isDeflatedZipEntry | back to summary |
|---|---|
| public final boolean isDeflatedZipEntry If true, the slice is a deflated zip entry, and needs to be inflated to access the content. | |
| nestedJarHandler | back to summary |
|---|---|
| protected final NestedJarHandler nestedJarHandler The | |
| parentSlice | back to summary |
|---|---|
| protected final Slice parentSlice The parent slice. | |
| sliceLength | back to summary |
|---|---|
| public long sliceLength The length of the slice, or -1L if unknown (for | |
| sliceStartPos | back to summary |
|---|---|
| public final long sliceStartPos The start position of the slice. | |
| Slice | back to summary |
|---|---|
| protected Slice(final Slice parentSlice, final long offset, final long length, final boolean isDeflatedZipEntry, final long inflatedLengthHint, final NestedJarHandler nestedJarHandler) Constructor for treating a range of a slice as a sub-slice.
| |
| Slice | back to summary |
|---|---|
| protected Slice(final long length, final boolean isDeflatedZipEntry, final long inflatedLengthHint, final NestedJarHandler nestedJarHandler) Constructor.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object o) Overrides java. 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 java. 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 abstract byte[] load() throws IOException Load the slice as a byte array.
| |
| loadAsString | back to summary |
|---|---|
| public String loadAsString() throws IOException Load the slice as a string.
| |
| open | back to summary |
|---|---|
| public InputStream open() throws IOException Open this
| |
| open | back to summary |
|---|---|
| public InputStream open(final Resource resourceToClose) throws IOException Open this
| |
| randomAccessReader | back to summary |
|---|---|
| public abstract RandomAccessReader randomAccessReader() Create a new
| |
| read | back to summary |
|---|---|
| public ByteBuffer read() throws IOException Read the slice into a
| |
| slice | back to summary |
|---|---|
| public abstract Slice slice(long offset, long length, boolean isDeflatedZipEntry, final long inflatedLengthHint) Get a child
| |