Methods Summary |
---|
protected abstract void | build(java.nio.ByteBuffer data)Processes the data and sets the position of the data buffer to just after the end of this fields data
ready for processing next field.
|
protected abstract byte[] | getDataBytes()
|
public abstract org.jaudiotagger.tag.mp4.field.Mp4FieldType | getFieldType()
|
public java.lang.String | getId()
return id;
|
protected byte[] | getIdBytes()
return Utils.getDefaultBytes(getId(), "ISO-8859-1");
|
public byte[] | getRawContent()Convert back to raw content, includes parent and data atom as views as one thing externally
logger.fine("Getting Raw data for:" + getId());
try
{
//Create Data Box
byte[] databox = getRawContentDataOnly();
//Wrap in Parent box
ByteArrayOutputStream outerbaos = new ByteArrayOutputStream();
outerbaos.write(Utils.getSizeBEInt32(Mp4BoxHeader.HEADER_LENGTH + databox.length));
outerbaos.write(Utils.getDefaultBytes(getId(), "ISO-8859-1"));
outerbaos.write(databox);
return outerbaos.toByteArray();
}
catch (IOException ioe)
{
//This should never happen as were not actually writing to/from a file
throw new RuntimeException(ioe);
}
|
public byte[] | getRawContentDataOnly()Get raw content for the data component only
logger.fine("Getting Raw data for:" + getId());
try
{
//Create Data Box
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] data = getDataBytes();
baos.write(Utils.getSizeBEInt32(Mp4DataBox.DATA_HEADER_LENGTH + data.length));
baos.write(Utils.getDefaultBytes(Mp4DataBox.IDENTIFIER, "ISO-8859-1"));
baos.write(new byte[]{0});
baos.write(new byte[]{0, 0, (byte) getFieldType().getFileClassId()});
baos.write(new byte[]{0, 0, 0, 0});
baos.write(data);
return baos.toByteArray();
}
catch (IOException ioe)
{
//This should never happen as were not actually writing to/from a file
throw new RuntimeException(ioe);
}
|
public void | isBinary(boolean b)
/* One cannot choose if an arbitrary block can be binary or not */
|
public boolean | isCommon()
return id.equals(Mp4FieldKey.ARTIST.getFieldName()) || id.equals(Mp4FieldKey.ALBUM.getFieldName()) || id.equals(Mp4FieldKey.TITLE.getFieldName()) || id.equals(Mp4FieldKey.TRACK.getFieldName()) || id.equals(Mp4FieldKey.DAY.getFieldName()) || id.equals(Mp4FieldKey.COMMENT.getFieldName()) || id.equals(Mp4FieldKey.GENRE.getFieldName());
|