Class NbtBinarySerializer

java.lang.Object
com.comphenix.protocol.wrappers.nbt.io.NbtBinarySerializer

public class NbtBinarySerializer extends Object
  • Field Details

    • DEFAULT

      public static final NbtBinarySerializer DEFAULT
      Retrieve a default instance of the NBT binary serializer.
  • Constructor Details

    • NbtBinarySerializer

      public NbtBinarySerializer()
  • Method Details

    • serialize

      public <T> void serialize(NbtBase<T> value, DataOutput destination)
      Write the content of a wrapped NBT tag to a stream.
      Type Parameters:
      T - Type
      Parameters:
      value - - the NBT tag to write.
      destination - - the destination stream.
    • deserialize

      public <TType> NbtWrapper<TType> deserialize(DataInput source)
      Load an NBT tag from a stream.
      Type Parameters:
      TType - Type
      Parameters:
      source - - the input stream.
      Returns:
      An NBT tag.
    • deserializeCompound

      public NbtCompound deserializeCompound(DataInput source)
      Load an NBT compound from a stream.
      Parameters:
      source - - the input stream.
      Returns:
      An NBT compound.
    • deserializeList

      public <T> NbtList<T> deserializeList(DataInput source)
      Load an NBT list from a stream.
      Type Parameters:
      T - Type
      Parameters:
      source - - the input stream.
      Returns:
      An NBT list.