Module syntaxnbt

Class TagByteArray


public class TagByteArray extends TagArray<Byte,byte[]>
A length-prefixed array of signed bytes. The prefix is a signed integer (thus 4 bytes)
Author:
SyntaxError404
  • Constructor Details

    • TagByteArray

      public TagByteArray()
      Constructs a new tag with an initial empty array
    • TagByteArray

      public TagByteArray(byte[] value)
      Constructs a new tag with an initial value
      Parameters:
      value - initial value
  • Method Details

    • set

      public TagByteArray set(int index, Number value)
      Description copied from class: TagArray
      Replaces an element at the specified position in the array
      Specified by:
      set in class TagArray<Byte,byte[]>
      Parameters:
      index - index of the element to replace
      value - the element to be stored at the specified position
      Returns:
      this array
    • get

      public Byte get(int index)
      Description copied from class: TagArray
      Returns the element at the specified position in this array
      Specified by:
      get in class TagArray<Byte,byte[]>
      Parameters:
      index - index of the element to be returned
      Returns:
      the element at the specified position in this array
    • getTag

      public TagByte getTag(int index)
      Description copied from class: TagArray
      Returns the tag at the specified position in this array as a TagNumber
      Specified by:
      getTag in class TagArray<Byte,byte[]>
      Parameters:
      index - index of the element to be returned
      Returns:
      the element at the specified position in this array
    • compare

      protected boolean compare(Tag<byte[]> tag)
      Description copied from class: Tag
      Compares two tags for equality
      Overrides:
      compare in class Tag<byte[]>
      Parameters:
      tag - tag to compare to
      Returns:
      whether the tags are equal