com.softsynth.jsyn
Interface ChunkHandler

All Known Implementing Classes:
SynthSampleAIFF, SynthSampleWAV

public interface ChunkHandler

Handle IFF Chunks as they are parsed from an IFF or RIFF file.

Author:
(C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
See Also:
ParseIFF, SynthSampleAIFF

Method Summary
 void handleChunk(ParseIFF parser, int ID, int numBytes)
          The parser will call this when it encounters a chunk that is not a FORM or LIST.
 void handleForm(ParseIFF parser, int ID, int numBytes, int type)
          The parser will call this when it encounters a FORM or LIST chunk that contains other chunks.
 

Method Detail

handleForm

void handleForm(ParseIFF parser,
                int ID,
                int numBytes,
                int type)
                throws java.io.IOException
The parser will call this when it encounters a FORM or LIST chunk that contains other chunks. This handler can either read the form's chunks, or let the parser find them and call handleChunk().

Parameters:
ID - a 4 byte identifier such as FORM_ID that identifies the IFF chunk type.
numBytes - number of bytes contained in the FORM, not counting the FORM type.
type - a 4 byte identifier such as AIFF_ID that identifies the FORM type.
Throws:
java.io.IOException

handleChunk

void handleChunk(ParseIFF parser,
                 int ID,
                 int numBytes)
                 throws java.io.IOException
The parser will call this when it encounters a chunk that is not a FORM or LIST. This handler can either read the chunk's, or ignore it. The parser will skip over any unread data. Do NOT read past the end of the chunk!

Parameters:
ID - a 4 byte identifier such as SSND_ID that identifies the IFF chunk type.
numBytes - number of bytes contained in the chunk, not counting the ID and size field.
Throws:
java.io.IOException