Interface BinaryTagIO.Reader

Enclosing class:
BinaryTagIO

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

    • read

      @NotNull default @NotNull CompoundBinaryTag read(@NotNull @NotNull Path path) throws IOException
      Reads a binary tag from path.

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

      The root name field is discarded.

      Parameters:
      path - the path
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • read

      @NotNull @NotNull CompoundBinaryTag read(@NotNull @NotNull Path path, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Reads a binary tag from path with a compression type.

      The root name field is discarded.

      Parameters:
      path - the path
      compression - the compression type
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • read

      @NotNull default @NotNull CompoundBinaryTag read(@NotNull @NotNull InputStream input) throws IOException
      Reads a binary tag from input.

      This is the equivalent of passing Compression#NONE as the second parameter to read(InputStream, Compression).

      The root name field is discarded.

      Parameters:
      input - the input stream
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • read

      @NotNull @NotNull CompoundBinaryTag read(@NotNull @NotNull InputStream input, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Reads a binary tag from input with a compression type.

      The root name field is discarded.

      Parameters:
      input - the input stream
      compression - the compression type
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • read

      @NotNull @NotNull CompoundBinaryTag read(@NotNull @NotNull DataInput input) throws IOException
      Reads a binary tag from input.

      The root name field is discarded.

      Parameters:
      input - the input stream
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • readNameless

      @NotNull default @NotNull CompoundBinaryTag readNameless(@NotNull @NotNull Path path) throws IOException
      Reads a binary tag from path.

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

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

      Parameters:
      path - the path
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • readNameless

      @NotNull @NotNull CompoundBinaryTag readNameless(@NotNull @NotNull Path path, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Reads a binary tag from path with a compression type.

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

      Parameters:
      path - the path
      compression - the compression type
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • readNameless

      @NotNull default @NotNull CompoundBinaryTag readNameless(@NotNull @NotNull InputStream input) throws IOException
      Reads a binary tag from input.

      This is the equivalent of passing Compression#NONE as the second parameter to read(InputStream, Compression).

      Doesn't read a root name from the InputStream at all, to match the wire protocol in modern game versions.

      Parameters:
      input - the input stream
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • readNameless

      @NotNull @NotNull CompoundBinaryTag readNameless(@NotNull @NotNull InputStream input, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Reads a binary tag from input with a compression type.

      Doesn't read a root name from the InputStream at all, to match the wire protocol in modern game versions.

      Parameters:
      input - the input stream
      compression - the compression type
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • readNameless

      @NotNull @NotNull CompoundBinaryTag readNameless(@NotNull @NotNull DataInput input) throws IOException
      Reads a binary tag from input.

      Doesn't read a root name from the DataInput at all, to match the wire protocol in modern game versions.

      Parameters:
      input - the input stream
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.15.0
      Since Minecraft:
      1.20.2
    • readNamed

      default @NotNull Map.Entry<String,CompoundBinaryTag> readNamed(@NotNull @NotNull Path path) throws IOException
      Reads a binary tag, with a name, from path.

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

      Parameters:
      path - the path
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • readNamed

      @NotNull Map.Entry<String,CompoundBinaryTag> readNamed(@NotNull @NotNull Path path, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Reads a binary tag, with a name, from path.
      Parameters:
      path - the path
      compression - the compression type
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • readNamed

      default @NotNull Map.Entry<String,CompoundBinaryTag> readNamed(@NotNull @NotNull InputStream input) throws IOException
      Reads a binary tag, with a name, from input.

      This is the equivalent of passing Compression#NONE as the second parameter to readNamed(InputStream, Compression).

      Parameters:
      input - the input stream
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • readNamed

      @NotNull Map.Entry<String,CompoundBinaryTag> readNamed(@NotNull @NotNull InputStream input, @NotNull @NotNull BinaryTagIO.Compression compression) throws IOException
      Reads a binary tag, with a name, from input.
      Parameters:
      input - the input stream
      compression - the compression type
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0
    • readNamed

      @NotNull Map.Entry<String,CompoundBinaryTag> readNamed(@NotNull @NotNull DataInput input) throws IOException
      Reads a binary tag, with a name, from input.
      Parameters:
      input - the input
      Returns:
      a binary tag
      Throws:
      IOException - if an exception was encountered while reading the tag
      Since:
      4.4.0