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

FrameBodyUSER

public class FrameBodyUSER extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody
Terms of use frame.

This frame contains a brief description of the terms of use and ownership of the file. More detailed information concerning the legal terms might be available through the "WCOP" frame. Newlines are allowed in the text. There may only be one "USER" frame in a tag.

<Header for 'Terms of use frame', ID: "USER">
Text encoding $xx
Language $xx xx xx
The actual text<text string according to encoding>

For more details, please refer to the ID3 specifications:

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

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

        //        setObject("Text Encoding", new Byte((byte) 0));
        //        setObject("Language", "");
        //        setObject("Text", "");
    
public FrameBodyUSER(FrameBodyUSER body)

        super(body);
    
public FrameBodyUSER(byte textEncoding, String language, String text)
Creates a new FrameBodyUSER datatype.

param
textEncoding
param
language
param
text

        setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding);
        setObjectValue(DataTypes.OBJ_LANGUAGE, language);
        setObjectValue(DataTypes.OBJ_TEXT, text);
    
public FrameBodyUSER(ByteBuffer byteBuffer, int frameSize)
Create a new FrameBodyUser by reading from byte buffer

param
byteBuffer
param
frameSize
throws
InvalidTagException

        super(byteBuffer, frameSize);
    
Methods Summary
public java.lang.StringgetIdentifier()
The ID3v2 frame identifier

return
the ID3v2 frame identifier for this frame type

        return ID3v24Frames.FRAME_ID_TERMS_OF_USE;
    
public java.lang.StringgetLanguage()

return
lanaguage

        return (String) getObjectValue(DataTypes.OBJ_LANGUAGE);
    
public voidsetOwner(java.lang.String language)

param
language

        setObjectValue(DataTypes.OBJ_LANGUAGE, language);
    
protected voidsetupObjectList()

        objectList.add(new NumberHashMap(DataTypes.OBJ_TEXT_ENCODING, this, TextEncoding.TEXT_ENCODING_FIELD_SIZE));
        objectList.add(new StringHashMap(DataTypes.OBJ_LANGUAGE, this, Languages.LANGUAGE_FIELD_SIZE));
        objectList.add(new StringSizeTerminated(DataTypes.OBJ_TEXT, this));
    
public voidwrite(java.io.ByteArrayOutputStream tagBuffer)
If the text cannot be encoded using current encoder, change the encoder

param
tagBuffer
throws
java.io.IOException

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