|
DixShtix | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dixshtix.niff.Parser
Parse chunk information from a niff file.
Inner Class Summary | |
static class |
Parser.DefaultContext
A simple modal class for keeping track of parser state. |
Field Summary | |
protected NiffParserContext |
context
|
protected InStream |
in
RIFF input stream. |
protected NiffParserListener |
listener
|
Constructor Summary | |
Parser(java.io.InputStream io)
Very Easy constructor. |
|
Parser(java.io.InputStream io,
NiffParserContext context)
Easy constructor. |
|
Parser(InStream riff,
NiffParserContext context)
Expert constructor. |
Method Summary | |
void |
beginContainerChunk(FourByteConstant containerType,
FourByteConstant chunkType,
NiffParserContext context)
|
void |
beginMiscChunk(java.lang.String chunkType,
NiffParserContext context)
|
void |
beginNiffChunk(FourByteConstant chunkType,
int expectedLength,
NiffParserContext context)
|
void |
beginNiffTag(byte tagID,
NiffParserContext context)
|
void |
beginRiffChunk(FourByteConstant chunkType,
NiffParserContext context)
|
void |
byteAttribute(java.lang.String attribute,
int value,
NiffParserContext context)
|
void |
dataBytes(byte[] data,
int offset,
int length,
NiffParserContext context)
|
void |
endContainerChunk(FourByteConstant containerType,
FourByteConstant chunkType,
NiffParserContext context)
|
void |
endMiscChunk(java.lang.String chunkType,
NiffParserContext context)
|
void |
endNiffChunk(FourByteConstant chunkType,
NiffParserContext context)
|
void |
endNiffTag(byte tagID,
NiffParserContext context)
|
void |
endRiffChunk(FourByteConstant chunkType,
NiffParserContext context)
|
void |
fillMiscChunk(java.lang.String chunkType,
NiffParserContext context)
|
void |
fillNiffChunk(FourByteConstant chunkType,
NiffParserContext context)
|
void |
fillNiffTag(byte tagID,
NiffParserContext context)
|
void |
fillRiffChunk(FourByteConstant chunkType,
NiffParserContext context)
|
void |
fontidxAttribute(java.lang.String attribute,
int value,
NiffParserContext context)
|
void |
fourccAttribute(java.lang.String attribute,
FourByteConstant value,
NiffParserContext context)
|
void |
longAttribute(java.lang.String attribute,
int value,
NiffParserContext context)
|
void |
parse()
Main routine for opening a NIFF file and dumping schematic of contents to the out; |
(package private) void |
parseKnownChunk(InStream prf,
IOChunk chunk)
Print Chunk and then descend recursively into the NIFF file hierarchy. |
protected int |
parseNiffChunk(FourByteConstant fcc,
byte[] data,
int offset,
int length)
|
protected int |
parseNiffTag(byte[] data,
int offset)
Parse NIFF tag data into a series of events. |
protected int |
parseRiffChunk(FourByteConstant fcc,
byte[] data,
int offset,
int length)
|
(package private) void |
parseTastedChunk(InStream prf,
FourByteConstant fcc)
Descend into the NIFF file hierarchy, recursively parsing chunks. |
(package private) void |
parseUnknownChunk(InStream prf)
Descend into the NIFF file hierarchy, recursively parsing chunks. |
void |
rationalAttribute(java.lang.String attribute,
int top,
int bottom,
NiffParserContext context)
|
void |
setListener(NiffParserListener listener)
|
void |
shortAttribute(java.lang.String attribute,
int value,
NiffParserContext context)
|
void |
signedbyteAttribute(java.lang.String attribute,
byte value,
NiffParserContext context)
|
void |
stringAttribute(java.lang.String attribute,
java.lang.String value,
NiffParserContext context)
|
void |
stroffsetAttribute(java.lang.String attribute,
int value,
NiffParserContext context)
|
Methods inherited from class java.lang.Object |
|
Field Detail |
protected InStream in
protected NiffParserContext context
protected NiffParserListener listener
Constructor Detail |
public Parser(InStream riff, NiffParserContext context)
public Parser(java.io.InputStream io, NiffParserContext context)
public Parser(java.io.InputStream io)
Method Detail |
public void setListener(NiffParserListener listener)
public void beginContainerChunk(FourByteConstant containerType, FourByteConstant chunkType, NiffParserContext context)
beginContainerChunk
in interface NiffParserListener
public void beginMiscChunk(java.lang.String chunkType, NiffParserContext context)
beginMiscChunk
in interface NiffParserListener
public void beginNiffChunk(FourByteConstant chunkType, int expectedLength, NiffParserContext context)
beginNiffChunk
in interface NiffParserListener
public void beginNiffTag(byte tagID, NiffParserContext context)
beginNiffTag
in interface NiffParserListener
public void beginRiffChunk(FourByteConstant chunkType, NiffParserContext context)
beginRiffChunk
in interface NiffParserListener
public void byteAttribute(java.lang.String attribute, int value, NiffParserContext context)
byteAttribute
in interface NiffParserListener
public void dataBytes(byte[] data, int offset, int length, NiffParserContext context)
dataBytes
in interface NiffParserListener
public void endContainerChunk(FourByteConstant containerType, FourByteConstant chunkType, NiffParserContext context)
endContainerChunk
in interface NiffParserListener
public void endMiscChunk(java.lang.String chunkType, NiffParserContext context)
endMiscChunk
in interface NiffParserListener
public void endNiffChunk(FourByteConstant chunkType, NiffParserContext context)
endNiffChunk
in interface NiffParserListener
public void endNiffTag(byte tagID, NiffParserContext context)
endNiffTag
in interface NiffParserListener
public void endRiffChunk(FourByteConstant chunkType, NiffParserContext context)
endRiffChunk
in interface NiffParserListener
public void fillMiscChunk(java.lang.String chunkType, NiffParserContext context)
fillMiscChunk
in interface NiffParserListener
public void fillNiffChunk(FourByteConstant chunkType, NiffParserContext context)
fillNiffChunk
in interface NiffParserListener
public void fillNiffTag(byte tagID, NiffParserContext context)
fillNiffTag
in interface NiffParserListener
public void fillRiffChunk(FourByteConstant chunkType, NiffParserContext context)
fillRiffChunk
in interface NiffParserListener
public void fontidxAttribute(java.lang.String attribute, int value, NiffParserContext context)
fontidxAttribute
in interface NiffParserListener
public void fourccAttribute(java.lang.String attribute, FourByteConstant value, NiffParserContext context)
fourccAttribute
in interface NiffParserListener
public void longAttribute(java.lang.String attribute, int value, NiffParserContext context)
longAttribute
in interface NiffParserListener
public void rationalAttribute(java.lang.String attribute, int top, int bottom, NiffParserContext context)
rationalAttribute
in interface NiffParserListener
public void shortAttribute(java.lang.String attribute, int value, NiffParserContext context)
shortAttribute
in interface NiffParserListener
public void signedbyteAttribute(java.lang.String attribute, byte value, NiffParserContext context)
signedbyteAttribute
in interface NiffParserListener
public void stringAttribute(java.lang.String attribute, java.lang.String value, NiffParserContext context)
stringAttribute
in interface NiffParserListener
public void stroffsetAttribute(java.lang.String attribute, int value, NiffParserContext context)
stroffsetAttribute
in interface NiffParserListener
protected int parseNiffTag(byte[] data, int offset)
data
- A buffer containing the whole of the NIFF tag.offset
- A 0-based index indicating the begining of the tag.protected int parseNiffChunk(FourByteConstant fcc, byte[] data, int offset, int length)
protected int parseRiffChunk(FourByteConstant fcc, byte[] data, int offset, int length)
void parseKnownChunk(InStream prf, IOChunk chunk)
prf
- An input stream of NIFF data.chunk
- The enclosing chunk, yet to be parsed.void parseUnknownChunk(InStream prf)
prf
- An input stream of NIFF data, positioned just prior to a chunk.void parseTastedChunk(InStream prf, FourByteConstant fcc)
prf
- An input stream of NIFF data, where fcc has already been read.fcc
- The first four bytes of the current NIFF chunk.public void parse()
|
DixShtix | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |