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 Type
    Method
    Description
    void
    addError(String message)
    Registers an error message for consumption after extraction.
    void
    processChunk(String fourCC, byte[] payload)
    Perform whatever processing is necessary for the type of chunk with its payload.
    boolean
    Gets whether this handler is interested in the specific chunk type.
    boolean
    Gets whether this handler is interested in the specific list type.
    boolean
    Gets whether the specified RIFF identifier is of interest to this handler.
  • Method Details

    • shouldAcceptRiffIdentifier

      boolean shouldAcceptRiffIdentifier(String identifier)
      Gets whether the specified RIFF identifier is of interest to this handler. Returning false causes 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(String fourCC)
      Gets whether this handler is interested in the specific chunk type. Returns true if the data should be copied into an array and passed to processChunk(String, byte[]), or false to 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(String fourCC)
      Gets whether this handler is interested in the specific list type. Returns true if the chunks should continue being processed, or false to 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(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 to shouldAcceptChunk(String) with the same fourCC returned true.
      Parameters:
      fourCC - the four character code of the chunk
      payload - they payload of the chunk as a byte array
    • addError

      void addError(String message)
      Registers an error message for consumption after extraction.
      Parameters:
      message - the error message