FileDocCategorySizeDatePackage
Mp4TagTextNumberField.javaAPI DocJaudiotagger 2.0.43621Wed Mar 30 16:12:10 BST 2011org.jaudiotagger.tag.mp4.field

Mp4TagTextNumberField

public class Mp4TagTextNumberField extends Mp4TagTextField
Represents simple text field that contains an array of number,

But reads the data content as an array of 16 bit unsigned numbers

Fields Summary
public static final int
NUMBER_LENGTH
protected List
numbers
Constructors Summary
public Mp4TagTextNumberField(String id, String numberArray)
Create a new number, already parsed in subclasses

param
id
param
numberArray


                     
        
    
        super(id, numberArray);
    
public Mp4TagTextNumberField(String id, ByteBuffer data)

        super(id, data);
    
Methods Summary
protected voidbuild(java.nio.ByteBuffer data)

        //Data actually contains a 'Data' Box so process data using this
        Mp4BoxHeader header = new Mp4BoxHeader(data);
        Mp4DataBox databox = new Mp4DataBox(header, data);
        dataSize = header.getDataLength();
        content = databox.getContent();
        numbers = databox.getNumbers();
    
public voidcopyContent(org.jaudiotagger.tag.TagField field)

        if (field instanceof Mp4TagTextNumberField)
        {
            this.content = ((Mp4TagTextNumberField) field).getContent();
            this.numbers = ((Mp4TagTextNumberField) field).getNumbers();
        }
    
protected byte[]getDataBytes()
Recreate the raw data content from the list of numbers

return

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        for (Short number : numbers)
        {
            try
            {
                baos.write(Utils.getSizeBEInt16(number));
            }
            catch (IOException e)
            {
                //This should never happen because we are not writing to file at this point.
                throw new RuntimeException(e);
            }
        }
        return baos.toByteArray();
    
public Mp4FieldTypegetFieldType()

return
type numeric

        return Mp4FieldType.IMPLICIT;
    
public java.util.ListgetNumbers()

return
the individual numbers making up this field

        return numbers;