Package com.io7m.jspiel.api
Interface RiffChunkBuilderType
- All Superinterfaces:
AutoCloseable
A builder for RIFF chunks.
It is an error to attempt to close a chunk without having called either of
addSubChunk(RiffChunkID)
or setDataWriter(RiffChunkDataWriterType)
.-
Method Summary
Modifier and TypeMethodDescriptionAdd a subchunk.void
close()
setDataWriter
(RiffChunkDataWriterType writer) Set the data writer for the chunk.Set the form of the chunk.Set the form of the chunk.setID
(RiffChunkID id) Set the ID of the chunk.setSize
(long size) Set the declared size of the chunk.setSize
(OptionalLong size) Set the declared size of the chunk.
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IllegalStateException
-
setSize
Set the declared size of the chunk.- Parameters:
size
- The size- Returns:
- The current builder
-
setSize
Set the declared size of the chunk.- Parameters:
size
- The size- Returns:
- The current builder
-
setID
Set the ID of the chunk.- Parameters:
id
- The id- Returns:
- The current builder
-
setForm
Set the form of the chunk.- Parameters:
form
- The form- Returns:
- The current builder
-
setForm
Set the form of the chunk.- Parameters:
form
- The form- Returns:
- The current builder
-
setDataWriter
Set the data writer for the chunk.- Parameters:
writer
- The data writer- Returns:
- The current builder
- Throws:
IllegalStateException
- IfaddSubChunk(RiffChunkID)
has already been called for this chunk
-
addSubChunk
Add a subchunk.- Parameters:
id
- The id of the chunk- Returns:
- A builder for the subchunk
- Throws:
IllegalStateException
- IfsetDataWriter(RiffChunkDataWriterType)
has already been called for this chunk
-