13
0
geforkt von Mirrors/Velocity

Fix DataFormatException with java decompression (#195)

Dieser Commit ist enthalten in:
Willsr71 2019-04-27 19:04:28 -04:00 committet von Andrew Steinborn
Ursprung dc6613a328
Commit 961e3ece27

Datei anzeigen

@ -28,7 +28,8 @@ public class JavaVelocityCompressor implements VelocityCompressor {
ensureNotDisposed();
if (source.hasArray()) {
inflater.setInput(source.array(), source.arrayOffset(), source.readableBytes());
inflater.setInput(source.array(), source.arrayOffset() + source.readerIndex(),
source.readableBytes());
} else {
byte[] inData = new byte[source.readableBytes()];
source.readBytes(inData);
@ -47,7 +48,8 @@ public class JavaVelocityCompressor implements VelocityCompressor {
ensureNotDisposed();
if (source.hasArray()) {
deflater.setInput(source.array(), source.arrayOffset(), source.readableBytes());
deflater.setInput(source.array(), source.arrayOffset() + source.readerIndex(),
source.readableBytes());
} else {
byte[] inData = new byte[source.readableBytes()];
source.readBytes(inData);