Mp4TagTextNumberFieldpublic 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
super(id, numberArray);
| public Mp4TagTextNumberField(String id, ByteBuffer data)
super(id, data);
|
Methods Summary |
---|
protected void | build(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 void | copyContent(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
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 Mp4FieldType | getFieldType()
return Mp4FieldType.IMPLICIT;
| public java.util.List | getNumbers()
return numbers;
|
|