Interface INBTWriter
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
NBTWriter
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 TypeMethodDescriptionvoidclose()Closes this writer and releases any associated system resources.voidwrite(ICompoundTag root) Writes the given compound tag as the root of an NBT file.
-
Method Details
-
write
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- TheICompoundTagto write as the file root- Throws:
IOException- If an error occurs during file writingIllegalArgumentException- If root is null
-
close
Closes this writer and releases any associated system resources.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- If an error occurs during resource cleanup
-