public class ID3v24FrameBodyPositionSynchronization extends ID3v24FrameBody
An position synchronization frame body is associated with an ID3v2.4 POSS
frame
which is used to
deliver information to the listener on how far into the audio stream he picked up. In effect, it states the time offset of the first frame in the stream.
The position synchronization frame body contains the following fields:
Field | Description | |
---|---|---|
1. | time stamp format | units of the position field. |
2. | position | the position in the audio the listener starts to receive, i.e. the beginning of the next frame. |
Constructor and Description |
---|
ID3v24FrameBodyPositionSynchronization()
The default constructor is called when creating a new frame.
|
ID3v24FrameBodyPositionSynchronization(java.io.InputStream inputStream,
int frameBodySize)
This constructor is called when reading in an existing frame from an .mp3 file.
|
ID3v24FrameBodyPositionSynchronization(TimeStampFormat timeStampFormat,
int position)
This constructor is called when creating a new frame.
|
Modifier and Type | Method and Description |
---|---|
int |
getPosition()
gets the position within the song.
|
TimeStampFormat |
getTimeStampFormat()
get the time stamp format.
|
void |
parse()
parses the raw bytes of the frame body and stores the parsed values in the frame's fields.
|
void |
setBuffer()
If the frame body's values have been modified, then resize the raw binary buffer and store the new values there.
|
void |
setPosition(int position)
sets the position within the song.
|
void |
setTimeStampFormat(TimeStampFormat timeStampFormat)
sets the time stamp format.
|
java.lang.String |
toString()
gets a string representation of the position synchronization frame body showing all of the frame's fields and their values.
|
getFrameType, getNextNullTerminator, getSize, isDirty, save, save
getNextNullTerminator, pricesToString, stringToBytes
bytesToInt, bytesToInt, bytesToShort, bytesToShort, bytesToSynchsafeInt, bytesToSynchsafeShort, formateDate, hex, hex, hex, intToBytes, littleEndianBytesToInt, pad, shortToBytes, synchsafeIntToBytes
public ID3v24FrameBodyPositionSynchronization()
public ID3v24FrameBodyPositionSynchronization(TimeStampFormat timeStampFormat, int position)
timeStampFormat
- units of the time stamp. see setTimeStampFormat(TimeStampFormat)
position
- position within songpublic ID3v24FrameBodyPositionSynchronization(java.io.InputStream inputStream, int frameBodySize) throws java.io.IOException
inputStream
- input stream pointing to a position synchronization frame body in the .mp3 file.frameBodySize
- size (in bytes) of the frame's body.java.io.IOException
- if there is an error while reading in the frame body.public void parse() throws java.lang.IllegalArgumentException
parse
in class ID3v24FrameBody
java.lang.IllegalArgumentException
- if an invalid value is detected while parsing the frame body's raw bytes.public int getPosition()
setPosition(int)
public TimeStampFormat getTimeStampFormat()
setTimeStampFormat(TimeStampFormat)
public void setTimeStampFormat(TimeStampFormat timeStampFormat)
timeStampFormat
- the units of the time stamp.getTimeStampFormat()
public void setPosition(int position) throws java.lang.IllegalArgumentException
position
- the position within the song.java.lang.IllegalArgumentException
- if the position is less than 0.getPosition()
public void setBuffer()
setBuffer
in class ID3v24FrameBody
public java.lang.String toString()
toString
in class java.lang.Object