javazoom.jl.decoder
Class Bitstream
java.lang.Object
|
+--javazoom.jl.decoder.Bitstream
- public final class Bitstream
- extends java.lang.Object
- implements BitstreamErrors
The Bistream
class is responsible for parsing
an MPEG audio bitstream.
REVIEW: much of the parsing currently occurs in the
various decoders. This should be moved into this class and associated
inner classes.
Constructor Summary |
Bitstream(java.io.InputStream in)
Construct a IBitstream that reads data from a
given InputStream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Bitstream
public Bitstream(java.io.InputStream in)
- Construct a IBitstream that reads data from a
given InputStream.
- Parameters:
in
- The InputStream to read from.
readFrame
public Header readFrame()
throws BitstreamException
- Reads and parses the next frame from the input source.
- Returns:
- the Header describing details of the frame read,
or null if the end of the stream has been reached.
closeFrame
public void closeFrame()
readBits
public int readBits(int n)
readCheckedBits
public int readCheckedBits(int n)
newBitstreamException
protected BitstreamException newBitstreamException(int errorcode)
newBitstreamException
protected BitstreamException newBitstreamException(int errorcode,
java.lang.Throwable throwable)
get_bits
public int get_bits(int number_of_bits)
- Read bits from buffer into the lower bits of an unsigned int.
The LSB contains the latest read bit of the stream.
(1 <= number_of_bits <= 16)