Package com.drew.imaging.riff
Interface RiffHandler
- All Known Implementing Classes:
AviRiffHandler,WavRiffHandler,WebpRiffHandler
public interface RiffHandler
Interface of an class capable of handling events raised during the reading of a RIFF file
via
RiffReader.- Author:
- Drew Noakes https://drewnoakes.com
-
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters an error message for consumption after extraction.voidprocessChunk(String fourCC, byte[] payload) Perform whatever processing is necessary for the type of chunk with its payload.booleanshouldAcceptChunk(String fourCC) Gets whether this handler is interested in the specific chunk type.booleanshouldAcceptList(String fourCC) Gets whether this handler is interested in the specific list type.booleanshouldAcceptRiffIdentifier(String identifier) Gets whether the specified RIFF identifier is of interest to this handler.
-
Method Details
-
shouldAcceptRiffIdentifier
Gets whether the specified RIFF identifier is of interest to this handler. Returningfalsecauses processing to stop after reading only the first twelve bytes of data.- Parameters:
identifier- The four character code identifying the type of RIFF data- Returns:
- true if processing should continue, otherwise false
-
shouldAcceptChunk
Gets whether this handler is interested in the specific chunk type. Returnstrueif the data should be copied into an array and passed toprocessChunk(String, byte[]), orfalseto avoid the copy and skip to the next chunk in the file, if any.- Parameters:
fourCC- the four character code of this chunk- Returns:
- true if
processChunk(String, byte[])should be called, otherwise false
-
shouldAcceptList
Gets whether this handler is interested in the specific list type. Returnstrueif the chunks should continue being processed, orfalseto avoid any unknown chunks within the list.- Parameters:
fourCC- the four character code of this chunk- Returns:
- true if
processChunk(String, byte[])should be called, otherwise false
-
processChunk
Perform whatever processing is necessary for the type of chunk with its payload. This is only called if a previous call toshouldAcceptChunk(String)with the samefourCCreturnedtrue.- Parameters:
fourCC- the four character code of the chunkpayload- they payload of the chunk as a byte array
-
addError
Registers an error message for consumption after extraction.- Parameters:
message- the error message
-