Interface BinaryTagIO.Writer

Enclosing class:
BinaryTagIO

public static interface BinaryTagIO.Writer
Since:
4.4.0
  • Method Details

    • write

      default void write(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull Path path) throws IOException
      Writes a binary tag to path with a compression type.

      This is the equivalent of passing Compression#NONE as the second parameter to write(CompoundBinaryTag, Path, Compression).

      An empty root name is written.

      Parameters:
      tag - the tag to write
      path - the path
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • write

      void write(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull Path path, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Writes a binary tag to path with a compression type.

      An empty root name is written.

      Parameters:
      tag - the tag to write
      path - the path
      compression - the compression type
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • write

      default void write(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull OutputStream output) throws IOException
      Writes a binary tag to output.

      This is the equivalent of passing BinaryTagIO.Compression.NONE as the second parameter to write(CompoundBinaryTag, OutputStream, Compression).

      An empty root name is written.

      Parameters:
      tag - the tag to write
      output - the output stream
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • write

      void write(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull OutputStream output, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Writes a binary tag to output with a compression type.

      An empty root name is written.

      Parameters:
      tag - the tag to write
      output - the output stream
      compression - the compression type
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • write

      void write(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull DataOutput output) throws IOException
      Writes a binary tag to output.

      An empty root name is written.

      Parameters:
      tag - the tag to write
      output - the output
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • writeNameless

      default void writeNameless(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull Path path) throws IOException
      Writes a binary tag to path with a compression type.

      This is the equivalent of passing Compression#NONE as the second parameter to write(CompoundBinaryTag, Path, Compression).

      Doesn't write a root name to the Path at all, to match the wire protocol in modern game versions.

      Parameters:
      tag - the tag to write
      path - the path
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • writeNameless

      void writeNameless(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull Path path, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Writes a binary tag to path with a compression type.

      Doesn't write a root name to the Path at all, to match the wire protocol in modern game versions.

      Parameters:
      tag - the tag to write
      path - the path
      compression - the compression type
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • writeNameless

      default void writeNameless(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull OutputStream output) throws IOException
      Writes a binary tag to output.

      This is the equivalent of passing BinaryTagIO.Compression.NONE as the second parameter to write(CompoundBinaryTag, OutputStream, Compression).

      Doesn't write a root name to the OutputStream at all, to match the wire protocol in modern game versions.

      Parameters:
      tag - the tag to write
      output - the output stream
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • writeNameless

      void writeNameless(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull OutputStream output, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Writes a binary tag to output with a compression type.

      Doesn't write a root name to the OutputStream at all, to match the wire protocol in modern game versions.

      Parameters:
      tag - the tag to write
      output - the output stream
      compression - the compression type
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • writeNameless

      void writeNameless(@NotNull @NotNull CompoundBinaryTag tag, @NotNull @NotNull DataOutput output) throws IOException
      Writes a binary tag to output.

      Doesn't write a root name to the DataOutput at all, to match the wire protocol in modern game versions.

      Parameters:
      tag - the tag to write
      output - the output
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • writeNamed

      default void writeNamed(@NotNull Map.Entry<String,CompoundBinaryTag> tag, @NotNull @NotNull Path path) throws IOException
      Writes a binary tag, with a name, to path.

      This is the equivalent of passing Compression#NONE as the second parameter to write(CompoundBinaryTag, Path, Compression).

      Parameters:
      tag - the named tag entry to write
      path - the path
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • writeNamed

      void writeNamed(@NotNull Map.Entry<String,CompoundBinaryTag> tag, @NotNull @NotNull Path path, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Writes a binary tag, with a name, to path with a compression type.
      Parameters:
      tag - the named tag entry to write
      path - the path
      compression - the compression type
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • writeNamed

      default void writeNamed(@NotNull Map.Entry<String,CompoundBinaryTag> tag, @NotNull @NotNull OutputStream output) throws IOException
      Writes a binary tag, with a name, to output.

      This is the equivalent of passing Compression#NONE as the second parameter to write(CompoundBinaryTag, OutputStream, Compression).

      Parameters:
      tag - the named tag entry to write
      output - the output stream
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • writeNamed

      void writeNamed(@NotNull Map.Entry<String,CompoundBinaryTag> tag, @NotNull @NotNull OutputStream output, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Writes a binary tag, with a name, to output with a compression type.
      Parameters:
      tag - the named tag entry to write
      output - the output stream
      compression - the compression type
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • writeNamed

      void writeNamed(@NotNull Map.Entry<String,CompoundBinaryTag> tag, @NotNull @NotNull DataOutput output) throws IOException
      Writes a binary tag, with a name, to output.
      Parameters:
      tag - the named tag entry to write
      output - the output
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0