Package 

Object NbtIO

    • Constructor Detail

    • Method Detail

      • writeNbtFileAsOriginal

         final static Unit writeNbtFileAsOriginal(OutputStream outputStream, NbtFile file)

        Calls writeNbtFile using the information stored in the NbtFile, uses the method's default when the information is missing (null). This method does not write the Bedrock Edition version and length headers.

        Parameters:
        outputStream - The stream that the file will be written
        file - The file that will be written to the stream
      • writeNbtFile

         final static Unit writeNbtFile(OutputStream outputStream, NbtFile file, Boolean compressed, Boolean littleEndian)

        Writes the NbtFile in the stream. This method does not write the Bedrock Edition version and length headers.

        Parameters:
        outputStream - The stream that the file will be written
        file - The file that will be written to the stream
        compressed - If the file will be compressed by GZIPOutputStream.
        littleEndian - Uses little endian to write to the stream as in Bedrock Edition
      • writeNbtFile

         final static Unit writeNbtFile(OutputStream outputStream, NbtFile file, Boolean compressed)

        Writes the NbtFile in the stream. This method does not write the Bedrock Edition version and length headers.

        Parameters:
        outputStream - The stream that the file will be written
        file - The file that will be written to the stream
        compressed - If the file will be compressed by GZIPOutputStream.
      • writeNbtFile

         final static Unit writeNbtFile(OutputStream outputStream, NbtFile file)

        Writes the NbtFile in the stream. This method does not write the Bedrock Edition version and length headers.

        Parameters:
        outputStream - The stream that the file will be written
        file - The file that will be written to the stream
      • writeNbtFileDirectly

         final static Unit writeNbtFileDirectly(DataOutput output, NbtFile file)

        Writes the NbtFile to the output. This method does not write the Bedrock Edition version and length headers.

        Parameters:
        output - Where the file will be written, needs to handle compression and endianness.
        file - The file that will be written to the output
      • readNbtFile

         final static NbtFile readNbtFile(InputStream inputStream, Boolean compressed, Boolean littleEndian, Boolean readHeaders)

        Read a NbtFile from the InputStream.

        Parameters:
        inputStream - The input stream that will be read
        compressed - If the file needs to be decompressed by GZIPInputStream
        littleEndian - Reads the NBT file using little endian byte order
        readHeaders - Reads the NBT version and length headers before the content These data are read in little endian byte order regardless of the littleEndian parameter.
      • readNbtFileDirectly

         final static NbtFile readNbtFileDirectly(DataInput input)

        Reads a NbtFile from the input. This method does not read the Bedrock Edition version and length headers.

        Parameters:
        input - Where the file will be read, needs to handle compression and endianness.
      • writeNbtTagDirectly

         final static Unit writeNbtTagDirectly(DataOutput output, NbtTag tag, Boolean writeTypeId)

        Writes the NbtTag directly, without name and optionally without type id.

        Parameters:
        output - Where the file will be written, needs to handle compression and endianness.
        tag - The tag that will be written to the output
        writeTypeId - If the first byte written should be the NBT tag type id.
      • readNbtTagDirectly

         final static <T extends NbtTag> T readNbtTagDirectly(DataInput input, Class<T> tagType)

        Reads a NbtTag of type T from the input directly, this is a reader for writeNbtTagDirectly.

        Parameters:
        input - Where the file will be read, needs to handle compression and endianness.
        tagType - The type of the tag that will be read, use null if the tag was written with writeTypeId enabled