Interface BinaryTagIO.Writer

    • Method Detail

      • write

        default void write​(@NotNull
                           @NotNull CompoundBinaryTag tag,
                           @NotNull
                           @NotNull java.nio.file.Path path)
                    throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.4.0
      • write

        void write​(@NotNull
                   @NotNull CompoundBinaryTag tag,
                   @NotNull
                   @NotNull java.nio.file.Path path,
                   @NotNull
                   @NotNull BinaryTagIO.Compression compression)
            throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.4.0
      • write

        default void write​(@NotNull
                           @NotNull CompoundBinaryTag tag,
                           @NotNull
                           @NotNull java.io.OutputStream output)
                    throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.4.0
      • write

        void write​(@NotNull
                   @NotNull CompoundBinaryTag tag,
                   @NotNull
                   @NotNull java.io.OutputStream output,
                   @NotNull
                   @NotNull BinaryTagIO.Compression compression)
            throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.4.0
      • write

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

        An empty root name is written.

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

        default void writeNameless​(@NotNull
                                   @NotNull CompoundBinaryTag tag,
                                   @NotNull
                                   @NotNull java.nio.file.Path path)
                            throws java.io.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:
        java.io.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 java.nio.file.Path path,
                           @NotNull
                           @NotNull BinaryTagIO.Compression compression)
                    throws java.io.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:
        java.io.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 java.io.OutputStream output)
                            throws java.io.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:
        java.io.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 java.io.OutputStream output,
                           @NotNull
                           @NotNull BinaryTagIO.Compression compression)
                    throws java.io.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:
        java.io.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 java.io.DataOutput output)
                    throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.15.0
        Since Minecraft:
        1.20.2
      • writeNamed

        default void writeNamed​(@NotNull java.util.Map.Entry<java.lang.String,​CompoundBinaryTag> tag,
                                @NotNull
                                @NotNull java.nio.file.Path path)
                         throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.4.0
      • writeNamed

        void writeNamed​(@NotNull java.util.Map.Entry<java.lang.String,​CompoundBinaryTag> tag,
                        @NotNull
                        @NotNull java.nio.file.Path path,
                        @NotNull
                        @NotNull BinaryTagIO.Compression compression)
                 throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.4.0
      • writeNamed

        default void writeNamed​(@NotNull java.util.Map.Entry<java.lang.String,​CompoundBinaryTag> tag,
                                @NotNull
                                @NotNull java.io.OutputStream output)
                         throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.4.0
      • writeNamed

        void writeNamed​(@NotNull java.util.Map.Entry<java.lang.String,​CompoundBinaryTag> tag,
                        @NotNull
                        @NotNull java.io.OutputStream output,
                        @NotNull
                        @NotNull BinaryTagIO.Compression compression)
                 throws java.io.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:
        java.io.IOException - if an exception was encountered while reading the tag
        Since:
        4.4.0
      • writeNamed

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