DixShtix

com.dixshtix.riff
Class Parser

java.lang.Object
  |
  +--com.dixshtix.riff.Parser

public class Parser
extends java.lang.Object

Generic reader of RIFF files.


Field Summary
protected  java.util.Map formParsables
          Chunk interpreters for Forms.
protected  InStream in
          RIFF input stream.
protected  java.util.Map listParsables
          Chunk interpreters for LISTs.
protected  java.util.Map readables
          Chunk interpreters for Chunks.
 
Constructor Summary
Parser(java.io.InputStream io)
          Easy constructor.
Parser(InStream riff)
          Expert constructor.
 
Method Summary
 void parse()
          Main routine for opening a RIFF file and parsing schematic of contents to the output object.
(package private)  void parsechunk(InStream prf)
          Descend into the RIFF file hierarchy, recursively parsing chunks.
(package private)  void parsechunk(InStream prf, FourByteConstant fcc)
          Descend into the RIFF file hierarchy, recursively parsing chunks.
(package private)  void parsechunk(InStream prf, IOChunk chunk)
          Parse Chunk and then descend recursively into the RIFF file hierarchy.
 void registerChunk(FourByteConstant fcc, Parsable reader)
           
 void registerForm(FourByteConstant formFlavor, FourByteConstant formType, Parsable reader)
           
 void registerList(FourByteConstant listType, Parsable reader)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

in

protected InStream in
RIFF input stream.

formParsables

protected java.util.Map formParsables
Chunk interpreters for Forms.

listParsables

protected java.util.Map listParsables
Chunk interpreters for LISTs.

readables

protected java.util.Map readables
Chunk interpreters for Chunks.
Constructor Detail

Parser

public Parser(InStream riff)
Expert constructor.

Parser

public Parser(java.io.InputStream io)
Easy constructor.
Method Detail

registerChunk

public void registerChunk(FourByteConstant fcc,
                          Parsable reader)

registerList

public void registerList(FourByteConstant listType,
                         Parsable reader)

registerForm

public void registerForm(FourByteConstant formFlavor,
                         FourByteConstant formType,
                         Parsable reader)

parsechunk

void parsechunk(InStream prf)
Descend into the RIFF file hierarchy, recursively parsing chunks.
Parameters:
prf - An input stream of RIFF data, positioned just prior to a chunk.

parsechunk

void parsechunk(InStream prf,
                FourByteConstant fcc)
Descend into the RIFF file hierarchy, recursively parsing chunks.
Parameters:
prf - An input stream of RIFF data, where fcc has already been read.
fcc - The first four bytes of the current RIFF chunk.

parsechunk

void parsechunk(InStream prf,
                IOChunk chunk)
Parse Chunk and then descend recursively into the RIFF file hierarchy.
Parameters:
prf - An input stream of RIFF data.
chunk - The enclosing chunk, to be printed.

parse

public void parse()
Main routine for opening a RIFF file and parsing schematic of contents to the output object.

DixShtix