public CompoundBinaryTag asCompound(final String input) throws IOException {
    try {
      final CharBuffer buffer = new CharBuffer(input);
      final TagStringReader parser = new TagStringReader(buffer);
      parser.legacy(this.acceptLegacy);
      final CompoundBinaryTag tag = parser.compound();
      if (buffer.skipWhitespace().hasMore()) {
        throw new IOException("Document had trailing content after first CompoundTag");
      }
      return tag;
    } catch (final StringTagParseException ex) {
      throw new IOException(ex);
    }
  }
Read the string into a compound tag structure.

<p>When working with untrusted input (such as from the network), users should be careful
to validate that the {@code input} string is of a reasonable size.</p>

@param input Input data
@return this
@throws IOException on any syntax errors
@since 4.0.0
nbt/src/main/java/net/kyori/adventure/nbt/TagStringIO.java