use of org.apache.flink.shaded.netty4.io.netty.buffer.ByteBufInputStream in project Glowstone by GlowstoneMC.
the class GlowBufUtils method readCompound.
private static CompoundTag readCompound(ByteBuf buf, boolean network) {
int idx = buf.readerIndex();
if (buf.readByte() == 0) {
return null;
}
buf.readerIndex(idx);
try (NbtInputStream str = new NbtInputStream(new ByteBufInputStream(buf), false)) {
return str.readCompound(network ? new NbtReadLimiter(2097152L) : NbtReadLimiter.UNLIMITED);
} catch (IOException e) {
return null;
}
}
Aggregations