org.jaudiotagger.tag.mp4.field
Class Mp4TagBinaryField

java.lang.Object
  extended by org.jaudiotagger.tag.mp4.Mp4TagField
      extended by org.jaudiotagger.tag.mp4.field.Mp4TagBinaryField
All Implemented Interfaces:
TagField
Direct Known Subclasses:
Mp4TagCoverField

public class Mp4TagBinaryField
extends Mp4TagField

Represents binary data

Subclassed by cover art field, TODO unaware of any other binary fields at the moment


Field Summary
 
Fields inherited from class org.jaudiotagger.tag.mp4.Mp4TagField
logger
 
Constructor Summary
Mp4TagBinaryField(java.lang.String id)
          Construct an empty Binary Field
Mp4TagBinaryField(java.lang.String id, byte[] data)
          Construct new binary field with binarydata provided
Mp4TagBinaryField(java.lang.String id, java.nio.ByteBuffer raw)
          Construct binary field from rawdata of audio file
 
Method Summary
 void copyContent(TagField field)
          This method copies the data of the given field to the current data.
 byte[] getData()
           
 int getDataSize()
           
 Mp4FieldType getFieldType()
           
 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, getRawContent, getRawContentDataOnly, isBinary, isCommon
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.TagField
toString
 

Constructor Detail

Mp4TagBinaryField

public Mp4TagBinaryField(java.lang.String id)
Construct an empty Binary Field

Parameters:
id -

Mp4TagBinaryField

public Mp4TagBinaryField(java.lang.String id,
                         byte[] data)
Construct new binary field with binarydata provided

Parameters:
id -
data -
Throws:
java.io.UnsupportedEncodingException

Mp4TagBinaryField

public Mp4TagBinaryField(java.lang.String id,
                         java.nio.ByteBuffer raw)
                  throws java.io.UnsupportedEncodingException
Construct binary field from rawdata of audio file

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

getFieldType

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

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.