Class BinaryTagIO


  • public final class BinaryTagIO
    extends java.lang.Object
    Serialization operations for binary tags.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readCompressedInputStream​(@NonNull java.io.InputStream input)
      Reads a compound tag from an input stream using GZIP decompression.
      static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readCompressedPath​(@NonNull java.nio.file.Path path)
      Reads a compound tag from path using GZIP decompression.
      static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readDataInput​(@NonNull java.io.DataInput input)
      Reads a compound tag from input.
      static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readInputStream​(@NonNull java.io.InputStream input)
      Reads a compound tag from an input stream.
      static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readPath​(@NonNull java.nio.file.Path path)
      Reads a compound tag from path.
      static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readString​(@NonNull java.lang.String input)
      Reads a compound tag from a String.
      static void writeCompressedOutputStream​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, @NonNull java.io.OutputStream output)
      Writes a compound tag to an output stream using GZIP compression.
      static void writeCompressedPath​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, @NonNull java.nio.file.Path path)
      Writes a compound tag to path using GZIP compression.
      static void writeDataOutput​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, @NonNull java.io.DataOutput output)
      Writes a compound tag to output.
      static void writeOutputStream​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, @NonNull java.io.OutputStream output)
      Writes a compound tag to an output stream.
      static void writePath​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag, @NonNull java.nio.file.Path path)
      Writes a compound tag to path.
      static @NonNull java.lang.String writeString​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)
      Writes a compound tag to a String.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • readPath

        public static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readPath​(@NonNull java.nio.file.Path path)
                                                                                       throws java.io.IOException
        Reads a compound tag from path.
        Parameters:
        path - the path
        Returns:
        the compound tag
        Throws:
        java.io.IOException - if an exception was encountered while reading a compound tag
      • readInputStream

        public static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readInputStream​(@NonNull java.io.InputStream input)
                                                                                              throws java.io.IOException
        Reads a compound tag from an input stream.
        Parameters:
        input - the input stream
        Returns:
        the compound tag
        Throws:
        java.io.IOException - if an exception was encountered while reading a compound tag
      • readCompressedPath

        public static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readCompressedPath​(@NonNull java.nio.file.Path path)
                                                                                                 throws java.io.IOException
        Reads a compound tag from path using GZIP decompression.
        Parameters:
        path - the path
        Returns:
        the compound tag
        Throws:
        java.io.IOException - if an exception was encountered while reading a compound tag
      • readCompressedInputStream

        public static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readCompressedInputStream​(@NonNull java.io.InputStream input)
                                                                                                        throws java.io.IOException
        Reads a compound tag from an input stream using GZIP decompression.
        Parameters:
        input - the input stream
        Returns:
        the compound tag
        Throws:
        java.io.IOException - if an exception was encountered while reading a compound tag
      • readDataInput

        public static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readDataInput​(@NonNull java.io.DataInput input)
                                                                                            throws java.io.IOException
        Reads a compound tag from input.
        Parameters:
        input - the input
        Returns:
        the compound tag
        Throws:
        java.io.IOException - if an exception was encountered while reading a compound tag
      • writePath

        public static void writePath​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag,
                                     @NonNull java.nio.file.Path path)
                              throws java.io.IOException
        Writes a compound tag to path.
        Parameters:
        tag - the compound tag
        path - the path
        Throws:
        java.io.IOException - if an exception was encountered while writing the compound tag
      • writeOutputStream

        public static void writeOutputStream​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag,
                                             @NonNull java.io.OutputStream output)
                                      throws java.io.IOException
        Writes a compound tag to an output stream.
        Parameters:
        tag - the compound tag
        output - the output stream
        Throws:
        java.io.IOException - if an exception was encountered while writing the compound tag
      • writeCompressedPath

        public static void writeCompressedPath​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag,
                                               @NonNull java.nio.file.Path path)
                                        throws java.io.IOException
        Writes a compound tag to path using GZIP compression.
        Parameters:
        tag - the compound tag
        path - the path
        Throws:
        java.io.IOException - if an exception was encountered while writing the compound tag
      • writeCompressedOutputStream

        public static void writeCompressedOutputStream​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag,
                                                       @NonNull java.io.OutputStream output)
                                                throws java.io.IOException
        Writes a compound tag to an output stream using GZIP compression.
        Parameters:
        tag - the compound tag
        output - the output stream
        Throws:
        java.io.IOException - if an exception was encountered while writing the compound tag
      • writeDataOutput

        public static void writeDataOutput​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag,
                                           @NonNull java.io.DataOutput output)
                                    throws java.io.IOException
        Writes a compound tag to output.
        Parameters:
        tag - the compound tag
        output - the output
        Throws:
        java.io.IOException - if an exception was encountered while writing the compound tag
      • readString

        public static @NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag readString​(@NonNull java.lang.String input)
                                                                                         throws java.io.IOException
        Reads a compound tag from a String.
        Parameters:
        input - the string
        Returns:
        the compound tag
        Throws:
        java.io.IOException - if an exception was encountered while reading a compound tag
      • writeString

        public static @NonNull java.lang.String writeString​(@NonNull com.github.steveice10.opennbt.tag.builtin.CompoundTag tag)
                                                     throws java.io.IOException
        Writes a compound tag to a String.
        Parameters:
        tag - the compound tag
        Returns:
        the string
        Throws:
        java.io.IOException - if an exception was encountered while writing the compound tag