C# Class javazoom.jl.decoder.Bitstream

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.
Inheritance: BitstreamErrors
Mostrar archivo Open project: RHY3756547/FreeSO Class Usage Examples

Public Methods

Method Description
close ( ) : void
closeFrame ( ) : void
get_bits ( int number_of_bits ) : int

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)

isSyncCurrentPosition ( int syncmode ) : bool

Determines if the next 4 bytes of the stream represent a frame header.

isSyncMark ( int headerstring, int syncmode, int word ) : bool
readBits ( int n ) : int
readCheckedBits ( int n ) : int
unreadFrame ( ) : void

Unreads the bytes read from the frame. @throws BitstreamException

Protected Methods

Method Description
newBitstreamException ( int errorcode ) : BitstreamException
newBitstreamException ( int errorcode, System throwable ) : BitstreamException

Private Methods

Method Description
Bitstream ( BackStream in_Renamed ) : System

Construct a IBitstream that reads data from a given InputStream. *

InitBlock ( ) : void
nextFrame ( ) : void

*

parse_frame ( ) : void

Parses the data previously read with read_frame_data().

readBytes ( sbyte b, int offs, int len ) : int

Simlar to readFully, but doesn't throw exception when EOF is reached.

readFrame ( ) : Header

Reads and parses the next frame from the input source.

readFully ( sbyte b, int offs, int len ) : void

Reads the exact number of bytes from the source input stream into a byte array. *

readNextFrame ( ) : Header
read_frame_data ( int bytesize ) : void

Reads the data for the next frame. The frame is not parsed until parse frame is called.

set_syncword ( int syncword0 ) : void

Set the word we want to sync the header to. In Big-Endian byte order

syncHeader ( sbyte syncmode ) : int

Get next 32 bits from bitstream. They are stored in the headerstring. syncmod allows Synchro flag ID The returned value is False at the end of stream.

Method Details

close() public method

public close ( ) : void
return void

closeFrame() public method

public closeFrame ( ) : void
return void

get_bits() public method

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)
public get_bits ( int number_of_bits ) : int
number_of_bits int
return int

isSyncCurrentPosition() public method

Determines if the next 4 bytes of the stream represent a frame header.
public isSyncCurrentPosition ( int syncmode ) : bool
syncmode int
return bool

isSyncMark() public method

public isSyncMark ( int headerstring, int syncmode, int word ) : bool
headerstring int
syncmode int
word int
return bool

newBitstreamException() protected method

protected newBitstreamException ( int errorcode ) : BitstreamException
errorcode int
return BitstreamException

newBitstreamException() protected method

protected newBitstreamException ( int errorcode, System throwable ) : BitstreamException
errorcode int
throwable System
return BitstreamException

readBits() public method

public readBits ( int n ) : int
n int
return int

readCheckedBits() public method

public readCheckedBits ( int n ) : int
n int
return int

unreadFrame() public method

Unreads the bytes read from the frame. @throws BitstreamException
public unreadFrame ( ) : void
return void