- fix GZIP and ZIP serializer copying the whole temporary buffer instead
of only the part where the data was written.
This commit is contained in:
parent
4c5850bf00
commit
1eedfa5a5f
@ -87,7 +87,8 @@ public class GZIPSerializer extends Serializer {
|
|||||||
ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
|
ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
|
||||||
GZIPOutputStream gzipOutput = new GZIPOutputStream(byteArrayOutput);
|
GZIPOutputStream gzipOutput = new GZIPOutputStream(byteArrayOutput);
|
||||||
|
|
||||||
gzipOutput.write(tempBuffer.array());
|
tempBuffer.flip();
|
||||||
|
gzipOutput.write(tempBuffer.array(), 0, tempBuffer.limit());
|
||||||
gzipOutput.flush();
|
gzipOutput.flush();
|
||||||
gzipOutput.finish();
|
gzipOutput.finish();
|
||||||
gzipOutput.close();
|
gzipOutput.close();
|
||||||
|
@ -98,7 +98,8 @@ public class ZIPSerializer extends Serializer {
|
|||||||
ZipEntry zipEntry = new ZipEntry("zip");
|
ZipEntry zipEntry = new ZipEntry("zip");
|
||||||
|
|
||||||
zipOutput.putNextEntry(zipEntry);
|
zipOutput.putNextEntry(zipEntry);
|
||||||
zipOutput.write(tempBuffer.array());
|
tempBuffer.flip();
|
||||||
|
zipOutput.write(tempBuffer.array(), 0, tempBuffer.limit());
|
||||||
zipOutput.flush();
|
zipOutput.flush();
|
||||||
zipOutput.closeEntry();
|
zipOutput.closeEntry();
|
||||||
zipOutput.close();
|
zipOutput.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user