3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Use buffered stream for compressed nbt reading

(See tux' open pr at adventure)
Dieser Commit ist enthalten in:
KennyTV 2020-07-15 12:10:24 +02:00
Ursprung e1464044a7
Commit 7fa80e1759
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -27,6 +27,7 @@ import com.github.steveice10.opennbt.tag.TagRegistry;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.io.BufferedInputStream;
import java.io.DataInput; import java.io.DataInput;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.DataOutput; import java.io.DataOutput;
@ -93,7 +94,7 @@ public final class BinaryTagIO {
*/ */
@NotNull @NotNull
public static CompoundTag readCompressedInputStream(final @NotNull InputStream input) throws IOException { public static CompoundTag readCompressedInputStream(final @NotNull InputStream input) throws IOException {
try (final DataInputStream dis = new DataInputStream(new GZIPInputStream(input))) { try (final DataInputStream dis = new DataInputStream(new BufferedInputStream(new GZIPInputStream(input)))) {
return readDataInput(dis); return readDataInput(dis);
} }
} }