code: private Tag readTag(int depth) throws IOException {
          int typeId = is.readByte() & 0xFF;
          TagType type = TagType.getById(typeId);
  
          String name;
          if (type != TagType.TAG_END) {
              int nameLength = is.readShort() & 0xFFFF;
              byte[] nameBytes = new byte[nameLength];
              is.readFully(nameBytes);
              name = new String(nameBytes, NBTConstants.CHARSET.name());
          } else {
              name = "";
          }
  
          return readTagPayload(type, name, depth);
      }
docs: Reads an NBT {@link Tag} from the stream.
  
  @param depth The depth of this tag.
  @return The tag that was read.
  @throws java.io.IOException if an I/O error occurs.