FileDocCategorySizeDatePackage
FrameBodyGEOB.javaAPI DocJaudiotagger 2.0.45930Wed Mar 30 16:12:02 BST 2011org.jaudiotagger.tag.id3.framebody

FrameBodyGEOB

public class FrameBodyGEOB extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody
General encapsulated object frame.

In this frame any type of file can be encapsulated. After the header, 'Frame size' and 'Encoding' follows 'MIME type' represented as as a terminated string encoded with ISO-8859-1. The filename is case sensitive and is encoded as 'Encoding'. Then follows a content description as terminated string, encoded as 'Encoding'. The last thing in the frame is the actual object. The first two strings may be omitted, leaving only their terminations. There may be more than one "GEOB" frame in each tag, but only one with the same content descriptor.

<Header for 'General encapsulated object', ID: "GEOB">
Text encoding $xx
MIME type <text string> $00
Filename <text string according to encoding> $00 (00)
Content description $00 (00)
Encapsulated object <binary data>

For more details, please refer to the ID3 specifications:

author
: Paul Taylor
author
: Eric Farng
version
$Id: FrameBodyGEOB.java 836 2009-11-12 15:44:07Z paultaylor $

Fields Summary
Constructors Summary
public FrameBodyGEOB()
Creates a new FrameBodyGEOB datatype.

        this.setObjectValue(DataTypes.OBJ_TEXT_ENCODING, TextEncoding.ISO_8859_1);
        this.setObjectValue(DataTypes.OBJ_MIME_TYPE, "");
        this.setObjectValue(DataTypes.OBJ_FILENAME, "");
        this.setObjectValue(DataTypes.OBJ_DESCRIPTION, "");
        this.setObjectValue(DataTypes.OBJ_DATA, new byte[0]);
    
public FrameBodyGEOB(FrameBodyGEOB body)

        super(body);
    
public FrameBodyGEOB(byte textEncoding, String mimeType, String filename, String description, byte[] object)
Creates a new FrameBodyGEOB datatype.

param
textEncoding
param
mimeType
param
filename
param
description
param
object

        this.setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding);
        this.setObjectValue(DataTypes.OBJ_MIME_TYPE, mimeType);
        this.setObjectValue(DataTypes.OBJ_FILENAME, filename);
        this.setObjectValue(DataTypes.OBJ_DESCRIPTION, description);
        this.setObjectValue(DataTypes.OBJ_DATA, object);
    
public FrameBodyGEOB(ByteBuffer byteBuffer, int frameSize)
Creates a new FrameBodyGEOB datatype.

param
byteBuffer
param
frameSize
throws
InvalidTagException if unable to create framebody from buffer

        super(byteBuffer, frameSize);
    
Methods Summary
public java.lang.StringgetDescription()

return
the description field

        return (String) getObjectValue(DataTypes.OBJ_DESCRIPTION);
    
public java.lang.StringgetIdentifier()

return

        return ID3v24Frames.FRAME_ID_GENERAL_ENCAPS_OBJECT;
    
public voidsetDescription(java.lang.String description)

param
description

        setObjectValue(DataTypes.OBJ_DESCRIPTION, description);
    
protected voidsetupObjectList()

        objectList.add(new NumberHashMap(DataTypes.OBJ_TEXT_ENCODING, this, TextEncoding.TEXT_ENCODING_FIELD_SIZE));
        objectList.add(new StringNullTerminated(DataTypes.OBJ_MIME_TYPE, this));
        objectList.add(new TextEncodedStringNullTerminated(DataTypes.OBJ_FILENAME, this));
        objectList.add(new TextEncodedStringNullTerminated(DataTypes.OBJ_DESCRIPTION, this));
        objectList.add(new ByteArraySizeTerminated(DataTypes.OBJ_DATA, this));
    
public voidwrite(java.io.ByteArrayOutputStream tagBuffer)
If the filename or description cannot be encoded using current encoder, change the encoder

        if (!((AbstractString) getObject(DataTypes.OBJ_FILENAME)).canBeEncoded())
        {
            this.setTextEncoding(TextEncoding.UTF_16);
        }
        if (!((AbstractString) getObject(DataTypes.OBJ_DESCRIPTION)).canBeEncoded())
        {
            this.setTextEncoding(TextEncoding.UTF_16);
        }
        super.write(tagBuffer);