13
0
geforkt von Mirrors/Velocity

Fix DataFormatException with java decompression ()

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