コード例 #1
0
 /**
  * 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);
   }
 }
コード例 #2
0
 /**
  * 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);
   }
 }