Class NBTWriter

java.lang.Object
org.mattrick.enbeet.io.NBTWriter

public class NBTWriter extends Object
  • Constructor Details

    • NBTWriter

      public NBTWriter(OutputStream out) throws IOException
      Create a new NBTWriter with the given output stream. Will apply Gzip compression by default.
      Parameters:
      out - The OutputStream to write to.
      Throws:
      IOException - if there was an issue creating the GzipOutputStream.
    • NBTWriter

      public NBTWriter(OutputStream out, boolean gzip) throws IOException
      Create a new NBTWriter, optionally applying Gzip compression.
      Parameters:
      out - The OutputStream to write to.
      gzip - Should this NBTWriter apply Gzip compression.
      Throws:
      IOException - if there was an issue creating the GzipOutputStream.
  • Method Details

    • write

      public void write(NBTCompound nbt) throws IOException
      Writes the given NBTCompound to the given OutputStream.
      Parameters:
      nbt - The NBTCompound to write.
      Throws:
      IOException - if there was an issue writing to the OutputStream.