public class MPEGSideInformation
extends java.lang.Object
The MPEG side information follows the MPEG audio frame header in an MPEG audio frame. It is a required part of an MPEG audio frame, and is used by mp3 players to
decode the mpeg audio samples.
Modifier and Type | Field and Description |
---|---|
static int |
HEADER_MAX_SIZE
side information is 32 bytes long for .mp3 files encoded with dual channels (stereo).
|
static int |
HEADER_MIN_SIZE
side information is 17 bytes long for .mp3 files encoded with a single channel (mono).
|
Constructor and Description |
---|
MPEGSideInformation()
default constructor.
|
MPEGSideInformation(byte[] bytes,
int size)
constructor.
|
MPEGSideInformation(java.io.InputStream inputStream,
int size)
constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData()
gets the raw binary data stored in the side information block in an mpeg audio frame.
|
int |
getSize()
gets the size (in bytes) of the side information block in an mpeg audio frame.
|
java.lang.String |
toString()
gets a string representation of the mpeg audio frame's side information.
|
public static final int HEADER_MIN_SIZE
public static final int HEADER_MAX_SIZE
public MPEGSideInformation()
public MPEGSideInformation(byte[] bytes, int size) throws ParseException
bytes
- the raw bytes of an MPEG audio frame.size
- size (in bytes) of the side information block in the mpeg audio frame.ParseException
- if an invalid size is specified, or if the byte stream is smaller than the specified size.public MPEGSideInformation(java.io.InputStream inputStream, int size) throws java.io.IOException, ParseException
inputStream
- input stream pointing to the side information data in an mpeg audio frame in an .mp3 file.size
- size (in bytes) of the side information block in the mpeg audio frame.java.io.IOException
- if there is an error while reading the side information from the .mp3 file.ParseException
- if an invalid size is specified, or if the byte stream is smaller than the specified size.public byte[] getData()
public int getSize()
public java.lang.String toString()
toString
in class java.lang.Object