Class PNGContainerWriter

java.lang.Object
net.mtrop.doom.struct.io.PNGContainerWriter
All Implemented Interfaces:
AutoCloseable

public class PNGContainerWriter extends Object implements AutoCloseable
  • Constructor Details

    • PNGContainerWriter

      public PNGContainerWriter(File f) throws FileNotFoundException
      Creates a new PNG container writer using a file to write to.
      Parameters:
      f - the file to read.
      Throws:
      FileNotFoundException - if the file to be created is an existing directory.
      SecurityException - if the file cannot be created.
    • PNGContainerWriter

      public PNGContainerWriter(OutputStream out)
      Creates a new PNG container writer using an input stream.
      Parameters:
      out - the output stream to write to.
  • Method Details

    • writeChunk

      public void writeChunk(String name, byte[] data) throws IOException
      Writes the next chunk in this container stream.
      Parameters:
      name - the name of the chunk. Must be length 4 (excluding whitespace), and follow the guidelines for naming necessary/private/etc. chunks.
      data - the data to write.
      Throws:
      IOException - if the write could not occur.
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException