public class ID3v23FrameBodyComments extends ID3v23FrameBody
A comments frame body is associated with an ID3v2.3 COMM
frame
which is intended for any kind of full text information that does not fit
in any other frame. The comments frame body contains the following fields:
Field | Description | |
---|---|---|
1. | encoding | character set used to encode the description and text fields. |
2. | language | language the comments are written in. |
3. | description | short description of the comments. This field is optional and be left empty (""). |
4. | text | actual comments about the .mp3 file. |
There may be more than one comment frame in an ID3v2.3 tag
, but only one with the same language and
description fields.
buffer, dirty, frameType
nextNullTerminatorIndex, nullTerminatorIndex
Constructor and Description |
---|
ID3v23FrameBodyComments()
The default constructor is called when creating a new frame.
|
ID3v23FrameBodyComments(Encoding encoding,
Language language,
java.lang.String description,
java.lang.String text)
This constructor is called when creating a new frame.
|
ID3v23FrameBodyComments(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 |
---|---|
java.lang.String |
getDescription()
gets the description.
|
Encoding |
getEncoding()
gets the character encoding of the description and text fields.
|
Language |
getLanguage()
gets the
language the comments are written in. |
java.lang.String |
getText()
get the actual comment(s) about the .mp3 file.
|
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 |
setDescription(java.lang.String description)
sets the description.
|
void |
setEncoding(Encoding encoding)
sets the character encoding of the description and text fields.
|
void |
setLanguage(Language language)
sets the
language the comments are written in. |
void |
setText(java.lang.String text)
sets the actual comment(s) about the .mp3 file.
|
java.lang.String |
toString()
gets a string representation of the comments 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 ID3v23FrameBodyComments()
public ID3v23FrameBodyComments(Encoding encoding, Language language, java.lang.String description, java.lang.String text)
encoding
- character set used to encode the description field.language
- ISO-639-2 language code indicating the language the comments were written in.description
- short description of the comment.text
- actual comment text.public ID3v23FrameBodyComments(java.io.InputStream inputStream, int frameBodySize) throws java.io.IOException
inputStream
- input stream pointing to a comments 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 Encoding getEncoding()
setEncoding(Encoding)
public void setEncoding(Encoding encoding)
encoding
- the character set used to encode the description and text fields. Only ISO 8859-1 and UTF-16 are allowed.getEncoding()
public Language getLanguage()
language
the comments are written in.setLanguage(Language)
public void setLanguage(Language language)
language
the comments are written in.language
- language
the comments are written in.getLanguage()
public java.lang.String getDescription()
setDescription(String)
public void setDescription(java.lang.String description)
description
- the description of the content.getDescription()
public java.lang.String getText()
setText(String)
public void setText(java.lang.String text)
text
- comment(s) about the .mp3 file.getText()
public void setBuffer()
setBuffer
in class ID3v23FrameBody
public java.lang.String toString()
toString
in class java.lang.Object