code: public static Tag readTag(InputStream in, boolean littleEndian) throws IOException {
          return readTag((DataInput) (littleEndian ? new LittleEndianDataInputStream(in) : new DataInputStream(in)));
      }
docs: Reads an NBT tag.
  
  @param in           Input stream to read from.
  @param littleEndian Whether to read little endian NBT.
  @return The read tag, or null if the tag is an end tag.
  @throws java.io.IOException If an I/O error occurs.