- public class RiffStreamReader
- extends RiffChunkReader
Parses RIFF data source.
RiffStreamReader is a
that provides access to the outermost chunk of a RIFF file. This the main interface through which a client begins processing a RIFF file.
Closes RIFF data source.
|Methods inherited from class lava.riff.RiffChunkReader
|Methods inherited from class java.lang.Object
public RiffStreamReader(IRiffInput rais)
- Processes RIFF header.
Details: This constructor initializes a new
RiffStreamReader to consume data from the given source. Before returning, this constructor performs an initial check to confirm that the input source appears to be a valid RIFF stream and throws an exception if the check fails. The check is performed as follows:
- The first four bytes of the file must be the ASCII characters 'R', 'I', 'F', 'F'.
- The next four bytes, taken as a little-endian, unsigned 32-bit integer (DWORD), should describe the length of the RIFF files outer data segment. If the DWORD is even, add 8 to it; if it is odd, add 9 to it. The resulting number should be equal to the length of the entire file.
If either of these two tests fail, a
FileFormatException is thrown. If the input source is unable to report the length of the data source, the second test will not be performed.
file - the RIFF file to process
- FileFormatException - if the file's header does not conform with the RIFF standard
public void close()
- Closes RIFF data source.
Details: This method closes the RIFF data source. All chunk readers created by this instance, including inner chunk readers created by those chunk readers, and so on, become unusable.
- java.io.IOException - if an I/O error occurs