Package net.md_5.bungee.nbt

# Interface Tag

All Known Subinterfaces:
  `TypedTag`

All Known Implementing Classes:
  `ByteArrayTag`, `ByteTag`, `CompoundTag`, `DoubleTag`, `EndTag`, `FloatTag`, `IntArrayTag`, `IntTag`, `ListTag`, `LongArrayTag`, `LongTag`, `NamedTag`, `ShortTag`, `StringTag`

public interface Tag

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `ARRAY_HEADER`
  `static final byte`
  `BYTE`
  `static final byte`
  `BYTE_ARRAY`
  `static final byte`
  `COMPOUND`
  `static final Supplier<? extends TypedTag>[]`
  `CONSTRUCTORS`
  `static final byte`
  `DOUBLE`
  `static final byte`
  `END`
  `static final byte`
  `FLOAT`
  `static final byte`
  `INT`
  `static final byte`
  `INT_ARRAY`
  `static final byte`
  `LIST`
  `static final byte`
  `LONG`
  `static final byte`
  `LONG_ARRAY`
  `static final int`
  `OBJECT_HEADER`
  `static final int`
  `OBJECT_REFERENCE`
  `static final byte`
  `SHORT`
  `static final byte`
  `STRING`
  `static final int`
  `STRING_SIZE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static TypedTag`
  `fromByteArray(byte[] data)`
  Deserializes the given byte array into a `TypedTag`.
  `static TypedTag`
  `fromByteArray(byte[] data, NBTLimiter limiter)`
  Deserializes the given byte array into a `TypedTag`, with limitations of the `NBTLimiter`.
  `void`
  `read(DataInput input, NBTLimiter limiter)`
  Reads the data into this tag.
  `static TypedTag`
  `readById(byte id, DataInput input, NBTLimiter limiter)`
  Reads a `Tag` from the given `DataInput`, based on the specified tag type, with limitations of the `NBTLimiter`.
  `static NamedTag`
  `readNamedTag(DataInput input, NBTLimiter limiter)`
  Reads a `NamedTag` from the given `DataInput`, with limitations of the `NBTLimiter`.
  `static byte[]`
  `toByteArray(TypedTag tag)`
  Serializes the given `TypedTag` into a byte array.
  `void`
  `write(DataOutput output)`
  Writes this tag into a `DataOutput`.

- ## Field Details

  - ### OBJECT_HEADER

    static final int OBJECT_HEADER
    See Also:
      - Constant Field Values

  - ### ARRAY_HEADER

    static final int ARRAY_HEADER
    See Also:
      - Constant Field Values

  - ### STRING_SIZE

    static final int STRING_SIZE
    See Also:
      - Constant Field Values

  - ### OBJECT_REFERENCE

    static final int OBJECT_REFERENCE
    See Also:
      - Constant Field Values

  - ### CONSTRUCTORS

    static final Supplier<? extends TypedTag>[] CONSTRUCTORS

  - ### END

    static final byte END
    See Also:
      - Constant Field Values

  - ### BYTE

    static final byte BYTE
    See Also:
      - Constant Field Values

  - ### SHORT

    static final byte SHORT
    See Also:
      - Constant Field Values

  - ### INT

    static final byte INT
    See Also:
      - Constant Field Values

  - ### LONG

    static final byte LONG
    See Also:
      - Constant Field Values

  - ### FLOAT

    static final byte FLOAT
    See Also:
      - Constant Field Values

  - ### DOUBLE

    static final byte DOUBLE
    See Also:
      - Constant Field Values

  - ### BYTE_ARRAY

    static final byte BYTE_ARRAY
    See Also:
      - Constant Field Values

  - ### STRING

    static final byte STRING
    See Also:
      - Constant Field Values

  - ### LIST

    static final byte LIST
    See Also:
      - Constant Field Values

  - ### COMPOUND

    static final byte COMPOUND
    See Also:
      - Constant Field Values

  - ### INT_ARRAY

    static final byte INT_ARRAY
    See Also:
      - Constant Field Values

  - ### LONG_ARRAY

    static final byte LONG_ARRAY
    See Also:
      - Constant Field Values

- ## Method Details

  - ### read

    void read(DataInput input, NBTLimiter limiter) throws IOException
    Reads the data into this tag.
    Parameters:
      `input` - the input to read from
      `limiter` - the limiter for this read operation
    Throws:
      `IOException` - if an exception occurs during io operations

  - ### write

    void write(DataOutput output) throws IOException
    Writes this tag into a `DataOutput`.
    Parameters:
      `output` - the output to write to
    Throws:
      `IOException` - if an exception occurs during io operations

  - ### readById

    static TypedTag readById(byte id, DataInput input, NBTLimiter limiter) throws IOException
    Reads a `Tag` from the given `DataInput`, based on the specified tag type, with limitations of the `NBTLimiter`.
    Parameters:
      `id` - the nbt type
      `input` - the input to read from
      `limiter` - the limiter for this read operation
    Returns:
      the deserialized `Tag`
    Throws:
      `IOException` - if an exception occurs during io operations

  - ### readNamedTag

    static NamedTag readNamedTag(DataInput input, NBTLimiter limiter) throws IOException
    Reads a `NamedTag` from the given `DataInput`, with limitations of the `NBTLimiter`.
    Parameters:
      `input` - the data input to read from
      `limiter` - the limiter for this read operation
    Returns:
      the deserialized `NamedTag`
    Throws:
      `IOException` - if an exception occurs during io operations

  - ### toByteArray

    static byte[] toByteArray(TypedTag tag) throws IOException
    Serializes the given `TypedTag` into a byte array. This is the inverse operation of `fromByteArray(byte[])`.
    Parameters:
      `tag` - the tag to convert
    Returns:
      the serialized byte array
    Throws:
      `IOException` - if an exception occurs during io operations

  - ### fromByteArray

    static TypedTag fromByteArray(byte[] data) throws IOException
    Deserializes the given byte array into a `TypedTag`. This is the inverse operation of `toByteArray(TypedTag)`.
    Parameters:
      `data` - the byte array to read from
    Returns:
      the deserialized `TypedTag`
    Throws:
      `IOException` - if an exception occurs during io operations

  - ### fromByteArray

    static TypedTag fromByteArray(byte[] data, NBTLimiter limiter) throws IOException
    Deserializes the given byte array into a `TypedTag`, with limitations of the `NBTLimiter`.
    Parameters:
      `data` - the byte array to read from
      `limiter` - the limiter for this read operation
    Returns:
      the deserialized `TypedTag`
    Throws:
      `IOException` - if an exception occurs during io operations