@Override public void read( final NbtInputStream inputStream, final boolean anonymous, final NbtLimiter limiter) throws IOException { super.read(inputStream, anonymous, limiter); limiter.incrementElementsCount(1); final int size = inputStream.readInt(); final long[] data = new long[size]; for (int i = 0; i < size; i++) { data[i] = inputStream.readLong(); } this.value = data; }
/** * Construct new NbtInputStream for deflated input stream and limiter, and then read nbt tag from * it. * * @param in input stream to be used. * @param limiter limiter to be used. * @return readed nbt tag from given stream. * @throws IOException if any read operation failed. */ public static NbtTag readTagDeflater(final InputStream in, final NbtLimiter limiter) throws IOException { try (NbtInputStream nbtIS = fromDeflater(in, limiter)) { return nbtIS.readTag(limiter); } }
/** * Construct new NbtInputStream for raw input stream and limiter, and then read nbt tag from it. * * @param in input stream to be used. * @param limiter limiter to be used. * @return readed nbt tag from given stream. * @throws IOException if any read operation failed. */ public static NbtTag readTag(final InputStream in, final NbtLimiter limiter) throws IOException { try (NbtInputStream nbtIS = new NbtInputStream(new NbtInputLimitedStream(in, limiter))) { return nbtIS.readTag(limiter); } }