public class ID3v23FrameBodyGeneralEncapsulatedObject extends ID3v23FrameBody
A general encapsulated object frame body is associated with an ID3v2.3 GEOB
frame
which is used to embed a file in the .mp3 file.
The file may be of any type. This is a generalization of the attached picture
frame which only allows image
files to be embedded in the .mp3 file. The general encapsulated object frame body contains the following fields:
Field | Description | |
---|---|---|
1. | encoding | character set used to encode the filename and description fields. |
2. | mimeType | the MIME type and subtype for the encapsulated object. This field is optional and may be left blank. |
3. | filename | name of the file from which the encapsulated object was read from. This field is optional and may be left blank. |
4. | description | description of the encapsulated object. |
5. | object | raw binary data of the encapsulated object. |
There may be more than one general encapsulated object frame in an ID3v2.3 tag
, but only one with the same
description field.
buffer, dirty, frameType
nextNullTerminatorIndex, nullTerminatorIndex
Constructor and Description |
---|
ID3v23FrameBodyGeneralEncapsulatedObject()
The default constructor is called when creating a new frame.
|
ID3v23FrameBodyGeneralEncapsulatedObject(Encoding encoding,
java.lang.String mimeType,
java.lang.String filename,
java.lang.String description,
byte[] object)
This constructor is called when creating a new frame.
|
ID3v23FrameBodyGeneralEncapsulatedObject(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 of the content.
|
Encoding |
getEncoding()
gets the character encoding of the filename and desctiption fields.
|
java.lang.String |
getFilename()
gets the name of the file from which the encapsulated object was read from.
|
java.lang.String |
getMimeType()
gets the mime type of the encapsulated object.
|
byte[] |
getObject()
gets the raw binary data of the encapsulated object.
|
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 of the content.
|
void |
setEncoding(Encoding encoding)
sets the character encoding of the filename and desctiption fields.
|
void |
setFilename(java.lang.String filename)
sets the name of the file from which the encapsulated object was read from.
|
void |
setMimeType(java.lang.String mimeType)
sets the mime type of the encapsulated object.
|
void |
setObject(byte[] object)
sets the raw binary data of the encapsulated object.
|
java.lang.String |
toString()
gets a string representation of the general encapsulated object 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 ID3v23FrameBodyGeneralEncapsulatedObject()
public ID3v23FrameBodyGeneralEncapsulatedObject(Encoding encoding, java.lang.String mimeType, java.lang.String filename, java.lang.String description, byte[] object)
encoding
- character set used to encode the description field.mimeType
- mime type of the encapsulated object. this field is optional, and may be empty, as is the filename field.filename
- filename that held the encapuslated object on disk.description
- description of the content.object
- raw binary data of the encapsulated object.public ID3v23FrameBodyGeneralEncapsulatedObject(java.io.InputStream inputStream, int frameBodySize) throws java.io.IOException
inputStream
- input stream pointing to a general encapsulated object 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 filename and desctiption fields. Only ISO 8859-1 and UTF-16 are allowed.getEncoding()
public java.lang.String getMimeType()
setMimeType(String)
public void setMimeType(java.lang.String mimeType)
mimeType
- the mime type.getMimeType()
public java.lang.String getFilename()
setFilename(String)
public void setFilename(java.lang.String filename)
filename
- the name of the file from which the encapsulated object was read from.getFilename()
public java.lang.String getDescription()
setDescription(String)
public void setDescription(java.lang.String description)
description
- the description of the content.getDescription()
public byte[] getObject()
setObject(byte[])
public void setObject(byte[] object)
object
- byte[] array containing the raw binary data of the encapsulated object.getObject()
public void setBuffer()
setBuffer
in class ID3v23FrameBody
public java.lang.String toString()
toString
in class java.lang.Object