org.jaudiotagger.tag.mp4.field
Class Mp4TagRawBinaryField

java.lang.Object
  extended by org.jaudiotagger.tag.mp4.Mp4TagField
      extended by org.jaudiotagger.tag.mp4.field.Mp4TagRawBinaryField
All Implemented Interfaces:
TagField

public class Mp4TagRawBinaryField
extends Mp4TagField

Represents raw binary data

We use this when we find an atom under the ilst atom that we do not recognise , that does not follow standard conventions in order to save the data without modification so it can be safetly written back to file


Field Summary
protected  byte[] dataBytes
           
protected  int dataSize
           
 
Fields inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
id, logger, parentHeader
 
Constructor Summary
Mp4TagRawBinaryField(Mp4BoxHeader header, java.nio.ByteBuffer raw)
          Construct binary field from rawdata of audio file
 
Method Summary
protected  void build(java.nio.ByteBuffer raw)
          Build from data

 void copyContent(TagField field)
          This method copies the data of the given field to the current data.
 byte[] getData()
           
protected  byte[] getDataBytes()
          Used when creating raw content
 int getDataSize()
           
 Mp4FieldType getFieldType()
           
 byte[] getRawContent()
          Convert back to raw content, includes parent and data atom as views as one thing externally
 boolean isBinary()
          Determines whether the represented field contains (is made up of) binary data, instead of text data.
Software can identify fields to be displayed because they are human readable if this method returns false.
 boolean isEmpty()
          Determines whether the content of the field is empty.
 void setData(byte[] d)
           
 
Methods inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
getId, getIdBytes, getRawContentDataOnly, isBinary, isCommon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.TagField
toString
 

Field Detail

dataSize

protected int dataSize

dataBytes

protected byte[] dataBytes
Constructor Detail

Mp4TagRawBinaryField

public Mp4TagRawBinaryField(Mp4BoxHeader header,
                            java.nio.ByteBuffer raw)
                     throws java.io.UnsupportedEncodingException
Construct binary field from rawdata of audio file

Parameters:
header -
raw -
Throws:
java.io.UnsupportedEncodingException
Method Detail

getFieldType

public Mp4FieldType getFieldType()
Specified by:
getFieldType in class Mp4TagField
Returns:
the field type of this field

getDataBytes

protected byte[] getDataBytes()
                       throws java.io.UnsupportedEncodingException
Used when creating raw content

Specified by:
getDataBytes in class Mp4TagField
Returns:
Throws:
java.io.UnsupportedEncodingException

build

protected void build(java.nio.ByteBuffer raw)
Build from data

After returning buffers position will be after the end of this atom

Specified by:
build in class Mp4TagField
Parameters:
raw -

isBinary

public boolean isBinary()
Description copied from interface: TagField
Determines whether the represented field contains (is made up of) binary data, instead of text data.
Software can identify fields to be displayed because they are human readable if this method returns false.

Returns:
true if field represents binary data (not human readable).

isEmpty

public boolean isEmpty()
Description copied from interface: TagField
Determines whether the content of the field is empty.

Returns:
true if no data is stored (or empty String).

getDataSize

public int getDataSize()

getData

public byte[] getData()

setData

public void setData(byte[] d)

copyContent

public void copyContent(TagField field)
Description copied from interface: TagField
This method copies the data of the given field to the current data.

Parameters:
field - The field containing the data to be taken.

getRawContent

public byte[] getRawContent()
                     throws java.io.UnsupportedEncodingException
Description copied from class: Mp4TagField
Convert back to raw content, includes parent and data atom as views as one thing externally

Specified by:
getRawContent in interface TagField
Overrides:
getRawContent in class Mp4TagField
Returns:
Binary data representing the current tag field.
Throws:
java.io.UnsupportedEncodingException - Most tag data represents text. In some cases the underlying implementation will need to convert the text data in java to a specific charset encoding. In these cases an UnsupportedEncodingException may occur.