Interface INBTWriter

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
NBTWriter

public interface INBTWriter extends AutoCloseable
Interface for writing NBT data to files with automatic compression handling. Handles the complexities of NBT file format including compression detection and proper binary encoding.
Author:
Paul Ferlitz
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this writer and releases any associated system resources.
    void
    Writes the given compound tag as the root of an NBT file.
  • Method Details

    • write

      void write(ICompoundTag root) throws IOException
      Writes the given compound tag as the root of an NBT file. According to NBT specification, only compound tags can serve as file roots in Java Edition. The writer handles compression and proper binary encoding automatically.
      Parameters:
      root - The ICompoundTag to write as the file root
      Throws:
      IOException - If an error occurs during file writing
      IllegalArgumentException - If root is null
    • close

      void close() throws IOException
      Closes this writer and releases any associated system resources.
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException - If an error occurs during resource cleanup