Package net.mtrop.doom.struct.io
Class PNGContainerWriter
java.lang.Object
net.mtrop.doom.struct.io.PNGContainerWriter
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
ConstructorDescriptionCreates a new PNG container writer using a file to write to.Creates a new PNG container writer using an input stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
writeChunk
(String name, byte[] data) Writes the next chunk in this container stream.
-
Constructor Details
-
PNGContainerWriter
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
Creates a new PNG container writer using an input stream.- Parameters:
out
- the output stream to write to.
-
-
Method Details
-
writeChunk
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
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-