public class ID3v23FrameBodyMusicCDIdentifier extends ID3v23FrameBody
A music CD identifier frame body is associated with an ID3v2.3 MCDI
frame
which is used to identify .mp3 songs that are ripped
from a CD, so that they can be identified in a database, such as CDDB. The frame body consists of a binary dump of the CD's Table Of Contents (TOC) which is a header of 4 bytes
and then 8 bytes/track on the CD plus 8 bytes for the 'lead out' making a maximum of 804 bytes. The offset to the beginning of every track on the CD should be described with a four byte
absolute CD-frame address per track, and not with absolute time. This frame requires a present and valid Track
frame, even if the CD's only got one track.
The music CD identifier frame body contains the following fields:
Field | Description | |
---|---|---|
1. | cdTOC | raw binary data of the CD's table of contents from which the .mp3 file was ripped. |
There may only be one music CD identifier frame in each tag.
buffer, dirty, frameType
nextNullTerminatorIndex, nullTerminatorIndex
Constructor and Description |
---|
ID3v23FrameBodyMusicCDIdentifier()
The default constructor is called when creating a new frame.
|
ID3v23FrameBodyMusicCDIdentifier(byte[] cdTOC)
This constructor is called when creating a new frame.
|
ID3v23FrameBodyMusicCDIdentifier(java.io.InputStream inputStream,
int frameBodySize)
This constructor is called when reading in an existing frame from an .mp3 file.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getCdTOC()
gets the raw binary data of the cd's table of contents from which this .mp3 was ripped.
|
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 |
setCdTOC(byte[] cdTOC)
sets the raw binary data of the cd's table of contents from which this .mp3 was ripped.
|
java.lang.String |
toString()
gets a string representation of the music CD identifier 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 ID3v23FrameBodyMusicCDIdentifier()
public ID3v23FrameBodyMusicCDIdentifier(byte[] cdTOC)
cdTOC
- raw binary data of the cd's table of contents from which this .mp3 was ripped.public ID3v23FrameBodyMusicCDIdentifier(java.io.InputStream inputStream, int frameBodySize) throws java.io.IOException
inputStream
- input stream pointing to a music cd identifier 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 the frame body.public void parse() throws java.lang.IllegalArgumentException
parse
in class ID3v23FrameBody
java.lang.IllegalArgumentException
- if an invalid value is detected while parsing the frame body's raw bytes.public byte[] getCdTOC()
setCdTOC(byte[])
public void setCdTOC(byte[] cdTOC)
cdTOC
- the binary data of the cd table of contents.getCdTOC()
public void setBuffer()
setBuffer
in class ID3v23FrameBody
public java.lang.String toString()
toString
in class java.lang.Object