Package com.drew.imaging.riff
Interface RiffHandler
-
- All Known Implementing Classes:
AviRiffHandler,WavRiffHandler,WebpRiffHandler
public interface RiffHandlerInterface of an class capable of handling events raised during the reading of a RIFF file viaRiffReader.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddError(java.lang.String message)Registers an error message for consumption after extraction.voidprocessChunk(java.lang.String fourCC, byte[] payload)Perform whatever processing is necessary for the type of chunk with its payload.booleanshouldAcceptChunk(java.lang.String fourCC)Gets whether this handler is interested in the specific chunk type.booleanshouldAcceptList(java.lang.String fourCC)Gets whether this handler is interested in the specific list type.booleanshouldAcceptRiffIdentifier(java.lang.String identifier)Gets whether the specified RIFF identifier is of interest to this handler.
-
-
-
Method Detail
-
shouldAcceptRiffIdentifier
boolean shouldAcceptRiffIdentifier(java.lang.String identifier)
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
boolean shouldAcceptChunk(java.lang.String fourCC)
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
boolean shouldAcceptList(java.lang.String fourCC)
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
void processChunk(java.lang.String fourCC, byte[] payload)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
void addError(java.lang.String message)
Registers an error message for consumption after extraction.- Parameters:
message- the error message
-
-