mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8326099: GZIPOutputStream should use Deflater.getBytesRead() instead of Deflater.getTotalIn()
Reviewed-by: jpai
This commit is contained in:
parent
490825fb91
commit
bb6b04897b
1 changed files with 3 additions and 1 deletions
|
@ -212,7 +212,9 @@ public class GZIPOutputStream extends DeflaterOutputStream {
|
||||||
*/
|
*/
|
||||||
private void writeTrailer(byte[] buf, int offset) throws IOException {
|
private void writeTrailer(byte[] buf, int offset) throws IOException {
|
||||||
writeInt((int)crc.getValue(), buf, offset); // CRC-32 of uncompr. data
|
writeInt((int)crc.getValue(), buf, offset); // CRC-32 of uncompr. data
|
||||||
writeInt(def.getTotalIn(), buf, offset + 4); // Number of uncompr. bytes
|
// RFC 1952: Size of the original (uncompressed) input data modulo 2^32
|
||||||
|
int iSize = (int) def.getBytesRead();
|
||||||
|
writeInt(iSize, buf, offset + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue