Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Fix DataFormatException with java decompression (#195)
Dieser Commit ist enthalten in:
Ursprung
dc6613a328
Commit
961e3ece27
@ -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);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren