diff options
author | Elliott Hughes <enh@google.com> | 2010-11-22 17:21:16 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-12-03 10:52:42 -0800 |
commit | 2d9c5fa8ce0182cd8c14736241b709fd50cab6f8 (patch) | |
tree | 5ed4768dcae26148845167ad1a19b9c857c216a9 /junit/src | |
parent | e4897c7a2d4ad0cd98cd054c970c02ca73e33fae (diff) | |
download | libcore-2d9c5fa8ce0182cd8c14736241b709fd50cab6f8.zip libcore-2d9c5fa8ce0182cd8c14736241b709fd50cab6f8.tar.gz libcore-2d9c5fa8ce0182cd8c14736241b709fd50cab6f8.tar.bz2 |
Slight cleanup of java.util.zip code, plus a bug fix.
The key fix is switching to zstream's next_in and next_out fields (the
pointers into the input and output buffers) rather than relying on the
integer "accounting" fields. If turns out in the Z_NEED_DICT case that
the accounting goes slightly awry. (We shouldn't have been using the
accounting anyway, because we were silently coercing longs to ints.)
The new code is simpler, clearer, and doesn't need a special case for
Z_NEED_DICT at all.
I've also removed yet another hand-written UTF-8 encoder, made Inflater
throw ArrayIndexOutOfBoundsExceptions with useful detail messages (factored
out into Arrays so we can make this change more widely), and
rewritten the Inflater and Deflater documentation.
The unit test reproduces the problem (and tests as many other cases as
it can too). Critical for testing this bug is that we needed to limit
the size of the input buffer so that zlib has to ask us for more input.
Bug: 3220923
Change-Id: I39e5456620eaa7f75d12d885db279f009ee3e8ef
Diffstat (limited to 'junit/src')
0 files changed, 0 insertions, 0 deletions