public BinaryTag array(char elementType) throws StringTagParseException {
    this.buffer.expect(Tokens.ARRAY_BEGIN)
      .expect(elementType)
      .expect(Tokens.ARRAY_SIGNATURE_SEPARATOR);

    elementType = Character.toLowerCase(elementType);
    if (elementType == Tokens.TYPE_BYTE) {
      return ByteArrayBinaryTag.byteArrayBinaryTag(this.byteArray());
    } else if (elementType == Tokens.TYPE_INT) {
      return IntArrayBinaryTag.intArrayBinaryTag(this.intArray());
    } else if (elementType == Tokens.TYPE_LONG) {
      return LongArrayBinaryTag.longArrayBinaryTag(this.longArray());
    } else {
      throw this.buffer.makeError("Type " + elementType + " is not a valid element type in an array!");
    }
  }
Similar to a list tag in syntax, but returning a single array tag rather than a list of tags.

@param elementType the indicator character for element type
@return array-typed tag
@throws StringTagParseException if the array was not properly terminated
nbt/src/main/java/net/kyori/adventure/nbt/TagStringReader.java