Interface ICustomFormat

All Known Implementing Classes:
BedrockLevelDatFormat, NoneFormat

public interface ICustomFormat
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    detect(byte[] data)
    Detect if the data is in this custom format.
    The data may have any length, checking the length is recommended.
    Read the custom data from the input.
    The input is in the correct endianess and decompressed if needed.
    void
    write(DataOutput out, byte[] data)
    Write the custom data to the output.
    The output is in the correct endianess and compressed if needed.
    It is required to write the data as it is the serialized nbt data.
  • Method Details

    • detect

      boolean detect(byte[] data)
      Detect if the data is in this custom format.
      The data may have any length, checking the length is recommended.
      Parameters:
      data - The data to check
      Returns:
      If the data is in this custom format
    • read

      DataInput read(DataInput in) throws IOException
      Read the custom data from the input.
      The input is in the correct endianess and decompressed if needed.
      Parameters:
      in - The input to read from
      Returns:
      The new input to read the nbt data from
      Throws:
      IOException - If an I/O error occurs
    • write

      void write(DataOutput out, byte[] data) throws IOException
      Write the custom data to the output.
      The output is in the correct endianess and compressed if needed.
      It is required to write the data as it is the serialized nbt data.
      Parameters:
      out - The output to write to
      data - The data to write
      Throws:
      IOException - If an I/O error occurs