|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.niffty.RIFF
Class for reading RIFF files.
Constructor Summary | |
RIFF(java.io.InputStream input,
java.lang.String formID)
Start reading a new RIFF stream as a RIFF form, requiring the chunkID to be "RIFX" and the form ID to be formID. |
|
RIFF(RIFF parent)
Begin reading a new RIFF chunk or list which is part of a parent chunk or list. |
|
RIFF(RIFF parent,
java.lang.String chunkID)
Begin reading a new RIFF chunk or list which is part of a parent chunk or list, requiring the chunkID to be chunkID. |
Method Summary | |
int |
getBytesRemaining()
Return the bytes remaining in this chunk or list. |
java.lang.String |
getChunkID()
Return the chunk ID which was read in the constructor. |
int[] |
getTagData()
Returns the tag data from the most recent call to readTag. |
int |
getTagID()
Returns the tag ID from the most recent call to readTag. |
int |
peekFirstChunkBYTE()
First, read four bytes from input stream (the chunk ID) and ignore them. |
java.lang.String |
peekFOURCC()
Read four bytes from input and return as a string, and restore the input stream to before the bytes were read. |
java.lang.String |
peekListID()
First, read four bytes from input stream. |
int |
readBYTE()
Read one byte from _input as a BYTE (unsigned one-byte) and return as an int. |
int |
readDWORD()
Read four bytes from _input as a DWORD (unsigned, most significant byte first) and return as an int. |
java.lang.String |
readFOURCC()
Read four bytes from input and return as a string. |
int |
readSHORT()
Read two bytes from _input as a SHORT (signed, most significant byte first) and return as an int. |
int |
readSIGNEDBYTE()
Read one byte from _input as a SIGNEDBYTE (signed one-byte) and return as an int. |
int |
readTag()
Read a tag from the input stream and return the tag ID. |
void |
requireFOURCC(java.lang.String value)
Read four bytes from input as a FOURCC and check against value, and if not equal, throw a RIFFFormatException. |
void |
skipChunk()
Skip past the next chunk in the input stream. |
void |
skipRemaining()
Skip over and discard the remaining bytes in this chunk or list. |
int |
tagByteAt(int index)
Interpret tagData[index] as a one-byte unsigned integer, and return as an int. |
java.lang.String |
tagDataString()
Returns the tag data from the most recent call to readTag as a String. |
int |
tagLongAt(int index)
Interpret tagData[index] through tagData[index+3] as a four-byte signed integer, most significant byte first and return as an int. |
int |
tagShortAt(int index)
Interpret tagData[index] and tagData[index+1] as a two-byte signed integer, most significant byte first and return as an int. |
int |
tagSignedByteAt(int index)
Interpret tagData[index] as a one-byte signed integer, and return as an int. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RIFF(java.io.InputStream input, java.lang.String formID) throws java.io.IOException, RIFFFormatException
input
- the RIFF input streamformID
- the expected form ID
java.io.IOException
- if an I/O error occurs
RIFFFormatException
- if the chunk ID is not "RIFX"requireFOURCC(java.lang.String)
public RIFF(RIFF parent) throws java.io.IOException
parent
- the parent RIFF object
java.io.IOException
- if an I/O error occursgetChunkID()
,
readFOURCC()
public RIFF(RIFF parent, java.lang.String chunkID) throws java.io.IOException, RIFFFormatException
parent
- the parent RIFF objectchunkID
- the required chunk ID
java.io.IOException
- if an I/O error occurs
RIFFFormatException
- if the chunk ID read is not chunkIDrequireFOURCC(java.lang.String)
Method Detail |
public java.lang.String getChunkID()
public int getBytesRemaining()
public int readBYTE() throws java.io.IOException
java.io.IOException
public int readDWORD() throws java.io.IOException
java.io.IOException
public int readSIGNEDBYTE() throws java.io.IOException
java.io.IOException
public int readSHORT() throws java.io.IOException
java.io.IOException
public java.lang.String readFOURCC() throws java.io.IOException
java.io.IOException
public java.lang.String peekFOURCC() throws java.io.IOException
java.io.IOException
public java.lang.String peekListID() throws java.io.IOException
java.io.IOException
public int peekFirstChunkBYTE() throws java.io.IOException
java.io.IOException
public void requireFOURCC(java.lang.String value) throws java.io.IOException, RIFFFormatException
value
- the expected FOURCC value
java.io.IOException
- if an I/O error occurs
RIFFFormatException
- if the chunk ID is not "RIFX"public void skipChunk() throws java.io.IOException
java.io.IOException
public void skipRemaining() throws java.io.IOException
java.io.IOException
public int readTag() throws java.io.IOException
java.io.IOException
getTagData()
,
getTagID()
public int getTagID()
readTag()
public int[] getTagData()
readTag()
public java.lang.String tagDataString()
readTag()
public int tagShortAt(int index) throws RIFFFormatException
index
- the position in tagData of the first byte of the SHORT
RIFFFormatException
- if the SHORT at index extends
beyond the length of tagData.public int tagLongAt(int index) throws RIFFFormatException
index
- the position in tagData of the first byte of the LONG
RIFFFormatException
- if the LONG at index extends
beyond the length of tagData.public int tagByteAt(int index) throws RIFFFormatException
index
- the position in tagData of the BYTE
RIFFFormatException
- if the index is
beyond the length of tagData.public int tagSignedByteAt(int index) throws RIFFFormatException
index
- the position in tagData of the SIGNEDBYTE
RIFFFormatException
- if the index is
beyond the length of tagData.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |