private int[] intArray() throws StringTagParseException {
    if (this.buffer.takeIf(Tokens.ARRAY_END)) {
      return EMPTY_INT_ARRAY;
    }

    final IntStream.Builder builder = IntStream.builder();
    while (this.buffer.hasMore()) {
      final BinaryTag value = this.tag();
      if (!(value instanceof IntBinaryTag)) {
        throw this.buffer.makeError("All elements of an int array must be ints!");
      }
      builder.add(((IntBinaryTag) value).intValue());
      if (this.separatorOrCompleteWith(Tokens.ARRAY_END)) {
        return builder.build().toArray();
      }
    }
    throw this.buffer.makeError("Reached end of document without array close");
  }
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