Age | Commit message (Collapse) | Author |
|
This assumes that the sizes of the arrays from the cache
will match the requested size. This works with BasicArrayCache
but isn't compliant with the ArrayCache API yet.
|
|
It could return a too high value when in the middle of
an uncompressed chunk.
|
|
This way errors get detected slightly quicker and we avoid
the need to check if the buffer position is still OK.
|
|
This avoids reallocating memory for each call.
This reduces pressure on the garbage collector
and in practice lowers the memory used by the
java process significantly when read() and
write(int) functions are used a lot.
On the other hand, this is stupid since most of the
time the read() and write(int) aren't (hopefully) used
since one gets better performance with functions that
process arrays of bytes. Thus, for most uses cases this
commit means that we are allocating a few unused one-byte
buffers that weren't previously allocated at all.
Similar thing was done earlier in the LZMA encoder in
the commit ec224582e44776a53874346dfe703dbbfcc6bd15.
|
|
To support LZMA1, support for reading from an InputStream is
needed. LZMA1-specific features are in FromStream while
LZMA2-specific features are in FromBuffer.
Move the rc.isInBufferOK() from LZMADecoder to LZMA2InputStream
since that is a LZMA2-specific thing.
|
|
|
|
|
|
All public input streams:
- If the stream has been closed and the function does
something I/O related, throw an exception.
- Don't call in.close() multiple times if close()
is called more than once.
All raw decoders:
- Check if the input stream is null because
otherwise the constructor won't detect it.
LZMA2InputStream:
- Handle presetDict == null correctly.
- Remove "throws IOException" from constructors.
SeekableXZInputStream, SimpleInputStream:
- Add available().
There are also related javadoc updates.
|
|
Input and output streams now throw IndexOutOfBoundsException
if given invalid buffer offset or length is given to .read
or .write functions.
|
|
|
|
The functionality of RawDecoder is now integrated
into BlockInputStream.
|
|
This supports only decompression in streamed mode using
LZMA2 and Delta filters. The integrity checks None,
CRC32, CRC64, and SHA-256 are supported.
|