org.jaudiotagger.tag.id3
Class ID3v24Tag

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTag
          extended by org.jaudiotagger.tag.id3.AbstractID3Tag
              extended by org.jaudiotagger.tag.id3.AbstractID3v2Tag
                  extended by org.jaudiotagger.tag.id3.ID3v24Tag
All Implemented Interfaces:
Tag

public class ID3v24Tag
extends AbstractID3v2Tag

Represents an ID3v2.4 tag.

Version:
$Id: ID3v24Tag.java,v 1.57 2009/11/12 15:42:58 paultaylor Exp $
Author:
: Paul Taylor, : Eric Farng

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jaudiotagger.tag.id3.AbstractID3v2Tag
AbstractID3v2Tag.FrameAndSubId
 
Field Summary
protected  int crcData
          CRC Checksum
protected  boolean crcDataFlag
          CRC Checksum calculated
protected  boolean experimental
          Experiemntal tag
protected  boolean extended
          Contains extended header
protected  boolean footer
          Contains a footer
protected  byte imageEncodingRestriction
          If Set Image encoding restrictions 0 No restrictions 1 Images are encoded only with PNG [PNG] or JPEG [JFIF].
protected  byte imageSizeRestriction
          If set Image size restrictions 00 No restrictions 01 All images are 256x256 pixels or smaller.
static byte MAJOR_VERSION
           
static int MASK_V24_COMPRESSION
          ID3v2.4 Header Footer bit mask
static int MASK_V24_CRC_DATA_PRESENT
          ID3v2.4 Extended header bit mask
static int MASK_V24_DATA_LENGTH_INDICATOR
          ID3v2.4 Header Footer bit mask
static int MASK_V24_ENCRYPTION
          ID3v2.4 Header Footer bit mask
static int MASK_V24_EXPERIMENTAL
          ID3v2.4 Header bit mask
static int MASK_V24_EXTENDED_HEADER
          ID3v2.4 Header bit mask
static int MASK_V24_FILE_ALTER_PRESERVATION
          ID3v2.4 Header Footer bit mask
static int MASK_V24_FOOTER_PRESENT
          ID3v2.4 Header bit mask
static int MASK_V24_FRAME_UNSYNCHRONIZATION
          ID3v2.4 Header Footer bit mask
static int MASK_V24_GROUPING_IDENTITY
          ID3v2.4 Header Footer bit mask
static int MASK_V24_IMAGE_ENCODING
          ID3v2.4 Extended header bit mask
static int MASK_V24_IMAGE_SIZE_RESTRICTIONS
          ID3v2.4 Extended header bit mask
static int MASK_V24_READ_ONLY
          ID3v2.4 Header Footer bit mask
static int MASK_V24_TAG_ALTER_PRESERVATION
          ID3v2.4 Header Footer bit mask
static int MASK_V24_TAG_RESTRICTIONS
          ID3v2.4 Extended header bit mask
static int MASK_V24_TAG_SIZE_RESTRICTIONS
          ID3v2.4 Extended header bit mask
static int MASK_V24_TAG_UPDATE
          ID3v2.4 Extended header bit mask
static int MASK_V24_TEXT_ENCODING_RESTRICTIONS
          ID3v2.4 Extended header bit mask
static int MASK_V24_TEXT_FIELD_SIZE_RESTRICTIONS
          ID3v2.4 Extended header bit mask
static int MASK_V24_UNSYNCHRONIZATION
          ID3v2.4 Header bit mask
protected  int paddingSize
          Tag padding
static byte RELEASE
           
static byte REVISION
           
protected static int TAG_EXT_HEADER_CRC_DATA_LENGTH
           
protected static int TAG_EXT_HEADER_CRC_LENGTH
           
protected static int TAG_EXT_HEADER_LENGTH
           
protected static int TAG_EXT_HEADER_RESTRICTION_DATA_LENGTH
           
protected static int TAG_EXT_HEADER_RESTRICTION_LENGTH
           
protected static int TAG_EXT_HEADER_UPDATE_LENGTH
           
protected static int TAG_EXT_NUMBER_BYTES_DATA_LENGTH
           
protected  boolean tagRestriction
          Tag has restrictions
protected  byte tagSizeRestriction
          If set then Tag Size Restrictions 00 No more than 128 frames and 1 MB total tag size.
protected  byte textEncodingRestriction
          If set Text encoding restrictions 0 No restrictions 1 Strings are only encoded with ISO-8859-1 [ISO-8859-1] or UTF-8 [UTF-8].
protected  byte textFieldSizeRestriction
          If set Text fields size restrictions 00 No restrictions 01 No string is longer than 1024 characters.
protected static java.lang.String TYPE_CRCDATA
           
protected static java.lang.String TYPE_EXPERIMENTAL
           
protected static java.lang.String TYPE_EXTENDED
           
protected static java.lang.String TYPE_FOOTER
           
protected static java.lang.String TYPE_IMAGEENCODINGRESTRICTION
           
protected static java.lang.String TYPE_IMAGESIZERESTRICTION
           
protected static java.lang.String TYPE_PADDINGSIZE
           
protected static java.lang.String TYPE_TAGRESTRICTION
           
protected static java.lang.String TYPE_TAGSIZERESTRICTION
           
protected static java.lang.String TYPE_TEXTENCODINGRESTRICTION
           
protected static java.lang.String TYPE_TEXTFIELDSIZERESTRICTION
           
protected static java.lang.String TYPE_UNSYNCHRONISATION
           
protected static java.lang.String TYPE_UPDATETAG
           
protected  boolean unsynchronization
          All frames in the tag uses unsynchronisation
protected  boolean updateTag
          Tag is an update
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3v2Tag
duplicateBytes, duplicateFrameId, emptyFrameBytes, FIELD_TAG_FLAG_LENGTH, FIELD_TAG_FLAG_POS, FIELD_TAG_MAJOR_VERSION_LENGTH, FIELD_TAG_MAJOR_VERSION_POS, FIELD_TAG_MINOR_VERSION_LENGTH, FIELD_TAG_MINOR_VERSION_POS, FIELD_TAG_SIZE_LENGTH, FIELD_TAG_SIZE_POS, FIELD_TAGID_LENGTH, FIELD_TAGID_POS, fileReadSize, frameMap, invalidFrameBytes, TAG_HEADER_LENGTH, TAG_ID, TAG_SIZE_INCREMENT, TYPE_BODY, TYPE_DUPLICATEBYTES, TYPE_DUPLICATEFRAMEID, TYPE_EMPTYFRAMEBYTES, TYPE_FILEREADSIZE, TYPE_HEADER, TYPE_INVALIDFRAMEBYTES
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag
logger, TAG_RELEASE
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTag
TYPE_TAG
 
Constructor Summary
ID3v24Tag()
          Creates a new empty ID3v2_4 datatype.
ID3v24Tag(AbstractTag mp3tag)
          Creates a new ID3v2_4 datatype based on another (non 2.4) tag
ID3v24Tag(java.nio.ByteBuffer buffer)
          Deprecated. use ID3v24Tag(ByteBuffer,String) instead
ID3v24Tag(java.nio.ByteBuffer buffer, java.lang.String loggingFilename)
          Creates a new ID3v2_4 datatype.
ID3v24Tag(ID3v24Tag copyObject)
          Copy Constructor, creates a new ID3v2_4 Tag based on another ID3v2_4 Tag
 
Method Summary
protected  void addFrame(AbstractID3v2Frame frame)
           
protected  void copyFrameIntoMap(java.lang.String id, AbstractID3v2Frame newFrame)
           
protected  void copyPrimitives(AbstractID3v2Tag copyObj)
          Copy primitives applicable to v2.4, this is used when cloning a v2.4 datatype and other objects such as v2.3 so need to check instanceof
 TagField createArtworkField(byte[] data, java.lang.String mimeType)
          Create Artwork
 TagField createField(Artwork artwork)
          Create artwork field based on the data in artwork
 ID3v24Frame createFrame(java.lang.String id)
          Create a new frame with the specified frameid
 void createStructure()
          Display the tag in an XMLFormat
 TagField createTagField(ID3v24FieldKey id3Key, java.lang.String value)
          Create Frame for Id3 Key

Only textual data supported at the moment, should only be used with frames that support a simple string argument.

 void deleteTagField(ID3v24FieldKey id3v24FieldKey)
          Delete fields with this id3v24FieldKey
 boolean equals(java.lang.Object obj)
          Is this tag equivalent to another
protected  java.lang.String getAlbumId()
           
protected  java.lang.String getArtistId()
           
 java.util.List<Artwork> getArtworkList()
           
protected  java.lang.String getCommentId()
           
 java.lang.String getFirst(ID3v24FieldKey id3v24FieldKey)
          Retrieve the first value that exists for this id3v24key
protected  AbstractID3v2Tag.FrameAndSubId getFrameAndSubIdFromGenericKey(FieldKey genericKey)
           
protected  java.lang.String getGenreId()
           
protected  ID3Frames getID3Frames()
           
 java.lang.String getIdentifier()
          Get full version
 byte getMajorVersion()
          Retrieve the Major Version
 java.util.Comparator getPreferredFrameOrderComparator()
           
 byte getRelease()
          Retrieve the Release
 byte getRevision()
          Retrieve the Revision
 int getSize()
          Return tag size based upon the sizes of the frames rather than the physical no of bytes between start of ID3Tag and start of Audio Data.
protected  java.lang.String getTitleId()
           
protected  java.lang.String getTrackId()
           
protected  java.lang.String getYearId()
           
 boolean isUnsynchronization()
          Are all frame swithin this tag unsynchronized

 void read(java.nio.ByteBuffer byteBuffer)
          
private  void readExtendedHeader(java.nio.ByteBuffer byteBuffer, int size)
          Read the optional extended header
protected  void readFrames(java.nio.ByteBuffer byteBuffer, int size)
          Read frames from tag
private  void readHeaderFlags(java.nio.ByteBuffer byteBuffer)
          Read header flags

 int readSize(java.nio.ByteBuffer buffer)
          Read the size of a tag, based on the value written in the tag header
 void write(java.io.File file, long audioStartLocation)
          Write tag to file.
 void write(java.nio.channels.WritableByteChannel channel)
          Write tag to channel.
private  java.nio.ByteBuffer writeHeaderToBuffer(int padding, int size)
          Write the ID3 header to the ByteBuffer.
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3v2Tag
addField, addField, addField, adjustPadding, calculateTagSize, copyFrames, createAlbumField, createArtistField, createCommentField, createField, createGenreField, createLinkedArtworkField, createStructureBody, createStructureHeader, createTitleField, createTrackField, createYearField, delete, deleteArtworkField, deleteField, doCreateTagField, doDeleteTagField, doGetFirst, get, getDuplicateBytes, getDuplicateFrameId, getEmptyFrameBytes, getFieldCount, getFields, getFields, getFileLockForWriting, getFileReadBytes, getFirst, getFirst, getFirstArtwork, getFirstField, getFirstField, getFirstGenre, getFirstTitle, getFirstTrack, getFirstYear, getFrame, getFrameCount, getFrameOfType, getInvalidFrameBytes, getV2TagSizeIfExists, hasCommonFields, hasField, hasFrame, hasFrameAndBody, hasFrameOfType, isEmpty, iterator, loadFrameIntoMap, mergeDuplicateFrames, removeFrame, removeFrameOfType, removeUnsupportedFrames, seek, setEncoding, setField, setField, setField, setFrame, setFrame, write, writeBufferToFile, writeFramesToBuffer
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag
getLoggingFilename, setLoggingFilename, toString
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
isSubsetOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.tag.Tag
toString
 

Field Detail

TYPE_FOOTER

protected static final java.lang.String TYPE_FOOTER
See Also:
Constant Field Values

TYPE_IMAGEENCODINGRESTRICTION

protected static final java.lang.String TYPE_IMAGEENCODINGRESTRICTION
See Also:
Constant Field Values

TYPE_IMAGESIZERESTRICTION

protected static final java.lang.String TYPE_IMAGESIZERESTRICTION
See Also:
Constant Field Values

TYPE_TAGRESTRICTION

protected static final java.lang.String TYPE_TAGRESTRICTION
See Also:
Constant Field Values

TYPE_TAGSIZERESTRICTION

protected static final java.lang.String TYPE_TAGSIZERESTRICTION
See Also:
Constant Field Values

TYPE_TEXTENCODINGRESTRICTION

protected static final java.lang.String TYPE_TEXTENCODINGRESTRICTION
See Also:
Constant Field Values

TYPE_TEXTFIELDSIZERESTRICTION

protected static final java.lang.String TYPE_TEXTFIELDSIZERESTRICTION
See Also:
Constant Field Values

TYPE_UPDATETAG

protected static final java.lang.String TYPE_UPDATETAG
See Also:
Constant Field Values

TYPE_CRCDATA

protected static final java.lang.String TYPE_CRCDATA
See Also:
Constant Field Values

TYPE_EXPERIMENTAL

protected static final java.lang.String TYPE_EXPERIMENTAL
See Also:
Constant Field Values

TYPE_EXTENDED

protected static final java.lang.String TYPE_EXTENDED
See Also:
Constant Field Values

TYPE_PADDINGSIZE

protected static final java.lang.String TYPE_PADDINGSIZE
See Also:
Constant Field Values

TYPE_UNSYNCHRONISATION

protected static final java.lang.String TYPE_UNSYNCHRONISATION
See Also:
Constant Field Values

TAG_EXT_HEADER_LENGTH

protected static int TAG_EXT_HEADER_LENGTH

TAG_EXT_HEADER_UPDATE_LENGTH

protected static int TAG_EXT_HEADER_UPDATE_LENGTH

TAG_EXT_HEADER_CRC_LENGTH

protected static int TAG_EXT_HEADER_CRC_LENGTH

TAG_EXT_HEADER_RESTRICTION_LENGTH

protected static int TAG_EXT_HEADER_RESTRICTION_LENGTH

TAG_EXT_HEADER_CRC_DATA_LENGTH

protected static int TAG_EXT_HEADER_CRC_DATA_LENGTH

TAG_EXT_HEADER_RESTRICTION_DATA_LENGTH

protected static int TAG_EXT_HEADER_RESTRICTION_DATA_LENGTH

TAG_EXT_NUMBER_BYTES_DATA_LENGTH

protected static int TAG_EXT_NUMBER_BYTES_DATA_LENGTH

MASK_V24_UNSYNCHRONIZATION

public static final int MASK_V24_UNSYNCHRONIZATION
ID3v2.4 Header bit mask

See Also:
Constant Field Values

MASK_V24_EXTENDED_HEADER

public static final int MASK_V24_EXTENDED_HEADER
ID3v2.4 Header bit mask

See Also:
Constant Field Values

MASK_V24_EXPERIMENTAL

public static final int MASK_V24_EXPERIMENTAL
ID3v2.4 Header bit mask

See Also:
Constant Field Values

MASK_V24_FOOTER_PRESENT

public static final int MASK_V24_FOOTER_PRESENT
ID3v2.4 Header bit mask

See Also:
Constant Field Values

MASK_V24_TAG_UPDATE

public static final int MASK_V24_TAG_UPDATE
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_CRC_DATA_PRESENT

public static final int MASK_V24_CRC_DATA_PRESENT
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TAG_RESTRICTIONS

public static final int MASK_V24_TAG_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TAG_SIZE_RESTRICTIONS

public static final int MASK_V24_TAG_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TEXT_ENCODING_RESTRICTIONS

public static final int MASK_V24_TEXT_ENCODING_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TEXT_FIELD_SIZE_RESTRICTIONS

public static final int MASK_V24_TEXT_FIELD_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_IMAGE_ENCODING

public static final int MASK_V24_IMAGE_ENCODING
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_IMAGE_SIZE_RESTRICTIONS

public static final int MASK_V24_IMAGE_SIZE_RESTRICTIONS
ID3v2.4 Extended header bit mask

See Also:
Constant Field Values

MASK_V24_TAG_ALTER_PRESERVATION

public static final int MASK_V24_TAG_ALTER_PRESERVATION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_FILE_ALTER_PRESERVATION

public static final int MASK_V24_FILE_ALTER_PRESERVATION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_READ_ONLY

public static final int MASK_V24_READ_ONLY
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_GROUPING_IDENTITY

public static final int MASK_V24_GROUPING_IDENTITY
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_COMPRESSION

public static final int MASK_V24_COMPRESSION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_ENCRYPTION

public static final int MASK_V24_ENCRYPTION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_FRAME_UNSYNCHRONIZATION

public static final int MASK_V24_FRAME_UNSYNCHRONIZATION
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

MASK_V24_DATA_LENGTH_INDICATOR

public static final int MASK_V24_DATA_LENGTH_INDICATOR
ID3v2.4 Header Footer bit mask

See Also:
Constant Field Values

crcDataFlag

protected boolean crcDataFlag
CRC Checksum calculated


experimental

protected boolean experimental
Experiemntal tag


extended

protected boolean extended
Contains extended header


unsynchronization

protected boolean unsynchronization
All frames in the tag uses unsynchronisation


crcData

protected int crcData
CRC Checksum


footer

protected boolean footer
Contains a footer


updateTag

protected boolean updateTag
Tag is an update


tagRestriction

protected boolean tagRestriction
Tag has restrictions


imageEncodingRestriction

protected byte imageEncodingRestriction
If Set Image encoding restrictions 0 No restrictions 1 Images are encoded only with PNG [PNG] or JPEG [JFIF].


imageSizeRestriction

protected byte imageSizeRestriction
If set Image size restrictions 00 No restrictions 01 All images are 256x256 pixels or smaller. 10 All images are 64x64 pixels or smaller. 11 All images are exactly 64x64 pixels, unless required otherwise.


tagSizeRestriction

protected byte tagSizeRestriction
If set then Tag Size Restrictions 00 No more than 128 frames and 1 MB total tag size. 01 No more than 64 frames and 128 KB total tag size. 10 No more than 32 frames and 40 KB total tag size. 11 No more than 32 frames and 4 KB total tag size.


textEncodingRestriction

protected byte textEncodingRestriction
If set Text encoding restrictions 0 No restrictions 1 Strings are only encoded with ISO-8859-1 [ISO-8859-1] or UTF-8 [UTF-8].


paddingSize

protected int paddingSize
Tag padding


textFieldSizeRestriction

protected byte textFieldSizeRestriction
If set Text fields size restrictions 00 No restrictions 01 No string is longer than 1024 characters. 10 No string is longer than 128 characters. 11 No string is longer than 30 characters. Note that nothing is said about how many bytes is used to represent those characters, since it is encoding dependent. If a text frame consists of more than one string, the sum of the strungs is restricted as stated.


RELEASE

public static final byte RELEASE
See Also:
Constant Field Values

MAJOR_VERSION

public static final byte MAJOR_VERSION
See Also:
Constant Field Values

REVISION

public static final byte REVISION
See Also:
Constant Field Values
Constructor Detail

ID3v24Tag

public ID3v24Tag()
Creates a new empty ID3v2_4 datatype.


ID3v24Tag

public ID3v24Tag(ID3v24Tag copyObject)
Copy Constructor, creates a new ID3v2_4 Tag based on another ID3v2_4 Tag

Parameters:
copyObject -

ID3v24Tag

public ID3v24Tag(AbstractTag mp3tag)
Creates a new ID3v2_4 datatype based on another (non 2.4) tag

Parameters:
mp3tag -

ID3v24Tag

public ID3v24Tag(java.nio.ByteBuffer buffer,
                 java.lang.String loggingFilename)
          throws TagException
Creates a new ID3v2_4 datatype.

Parameters:
buffer -
loggingFilename -
Throws:
TagException

ID3v24Tag

public ID3v24Tag(java.nio.ByteBuffer buffer)
          throws TagException
Deprecated. use ID3v24Tag(ByteBuffer,String) instead

Creates a new ID3v2_4 datatype.

Parameters:
buffer -
Throws:
TagException
Method Detail

getRelease

public byte getRelease()
Retrieve the Release

Specified by:
getRelease in class AbstractID3Tag
Returns:

getMajorVersion

public byte getMajorVersion()
Retrieve the Major Version

Specified by:
getMajorVersion in class AbstractID3Tag
Returns:

getRevision

public byte getRevision()
Retrieve the Revision

Specified by:
getRevision in class AbstractID3Tag
Returns:

copyPrimitives

protected void copyPrimitives(AbstractID3v2Tag copyObj)
Copy primitives applicable to v2.4, this is used when cloning a v2.4 datatype and other objects such as v2.3 so need to check instanceof

Overrides:
copyPrimitives in class AbstractID3v2Tag

addFrame

protected void addFrame(AbstractID3v2Frame frame)
Specified by:
addFrame in class AbstractID3v2Tag

copyFrameIntoMap

protected void copyFrameIntoMap(java.lang.String id,
                                AbstractID3v2Frame newFrame)
Overrides:
copyFrameIntoMap in class AbstractID3v2Tag

getIdentifier

public java.lang.String getIdentifier()
Description copied from class: AbstractID3Tag
Get full version

Overrides:
getIdentifier in class AbstractID3Tag
Returns:
identifier

getSize

public int getSize()
Return tag size based upon the sizes of the frames rather than the physical no of bytes between start of ID3Tag and start of Audio Data.

Overrides:
getSize in class AbstractID3v2Tag
Returns:
size

equals

public boolean equals(java.lang.Object obj)
Description copied from class: AbstractID3v2Tag
Is this tag equivalent to another

Overrides:
equals in class AbstractID3v2Tag
Parameters:
obj -
Returns:
equality

readSize

public int readSize(java.nio.ByteBuffer buffer)
Read the size of a tag, based on the value written in the tag header

Parameters:
buffer -
Returns:
Throws:
TagException

readHeaderFlags

private void readHeaderFlags(java.nio.ByteBuffer byteBuffer)
                      throws TagException
Read header flags

Log info messages for falgs that have been set and log warnings when bits have been set for unknown flags

Parameters:
byteBuffer -
Throws:
TagException

readExtendedHeader

private void readExtendedHeader(java.nio.ByteBuffer byteBuffer,
                                int size)
                         throws InvalidTagException
Read the optional extended header

Parameters:
byteBuffer -
size -
Throws:
InvalidTagException

read

public void read(java.nio.ByteBuffer byteBuffer)
          throws TagException

Specified by:
read in class AbstractTagItem
Parameters:
byteBuffer - file to read from
Throws:
TagException - on any exception generated by this library.

readFrames

protected void readFrames(java.nio.ByteBuffer byteBuffer,
                          int size)
Read frames from tag

Parameters:
byteBuffer -
size -

writeHeaderToBuffer

private java.nio.ByteBuffer writeHeaderToBuffer(int padding,
                                                int size)
                                         throws java.io.IOException
Write the ID3 header to the ByteBuffer.

TODO Calculate the CYC Data Check TODO Reintroduce Extended Header

Parameters:
padding - is the size of the padding
size - is the size of the body data
Returns:
ByteBuffer
Throws:
java.io.IOException

write

public void write(java.io.File file,
                  long audioStartLocation)
           throws java.io.IOException
Write tag to file.

Overrides:
write in class AbstractID3v2Tag
Throws:
java.io.IOException - TODO should be abstract

write

public void write(java.nio.channels.WritableByteChannel channel)
           throws java.io.IOException
Write tag to channel.

Overrides:
write in class AbstractID3v2Tag
Throws:
java.io.IOException - TODO should be abstract

createStructure

public void createStructure()
Display the tag in an XMLFormat

Overrides:
createStructure in class AbstractID3v2Tag

isUnsynchronization

public boolean isUnsynchronization()
Are all frame swithin this tag unsynchronized

Because synchronization occurs at the frame level it is not normally desirable to unsynchronize all frames and hence this flag is not normally set.

Returns:
are all frames within the tag unsynchronized

getArtistId

protected java.lang.String getArtistId()
Specified by:
getArtistId in class AbstractID3v2Tag
Returns:

getAlbumId

protected java.lang.String getAlbumId()
Specified by:
getAlbumId in class AbstractID3v2Tag
Returns:

getTitleId

protected java.lang.String getTitleId()
Specified by:
getTitleId in class AbstractID3v2Tag
Returns:

getTrackId

protected java.lang.String getTrackId()
Specified by:
getTrackId in class AbstractID3v2Tag
Returns:

getYearId

protected java.lang.String getYearId()
Specified by:
getYearId in class AbstractID3v2Tag
Returns:

getCommentId

protected java.lang.String getCommentId()
Specified by:
getCommentId in class AbstractID3v2Tag
Returns:

getGenreId

protected java.lang.String getGenreId()
Specified by:
getGenreId in class AbstractID3v2Tag
Returns:

createFrame

public ID3v24Frame createFrame(java.lang.String id)
Create a new frame with the specified frameid

Specified by:
createFrame in class AbstractID3v2Tag
Parameters:
id -
Returns:

createTagField

public TagField createTagField(ID3v24FieldKey id3Key,
                               java.lang.String value)
                        throws KeyNotFoundException,
                               FieldDataInvalidException
Create Frame for Id3 Key

Only textual data supported at the moment, should only be used with frames that support a simple string argument.

Parameters:
id3Key -
value -
Returns:
Throws:
KeyNotFoundException
FieldDataInvalidException

getFirst

public java.lang.String getFirst(ID3v24FieldKey id3v24FieldKey)
                          throws KeyNotFoundException
Retrieve the first value that exists for this id3v24key

Parameters:
id3v24FieldKey -
Returns:
Throws:
KeyNotFoundException

deleteTagField

public void deleteTagField(ID3v24FieldKey id3v24FieldKey)
                    throws KeyNotFoundException
Delete fields with this id3v24FieldKey

Parameters:
id3v24FieldKey -
Throws:
KeyNotFoundException

getFrameAndSubIdFromGenericKey

protected AbstractID3v2Tag.FrameAndSubId getFrameAndSubIdFromGenericKey(FieldKey genericKey)
Specified by:
getFrameAndSubIdFromGenericKey in class AbstractID3v2Tag

getID3Frames

protected ID3Frames getID3Frames()
Specified by:
getID3Frames in class AbstractID3v2Tag

getPreferredFrameOrderComparator

public java.util.Comparator getPreferredFrameOrderComparator()
Specified by:
getPreferredFrameOrderComparator in class AbstractID3v2Tag
Returns:
comparator used to order frames in preferred order for writing to file so that most important frames are written first.

getArtworkList

public java.util.List<Artwork> getArtworkList()
Returns:
a list of all artwork in this file using the format indepedent Artwork class

createField

public TagField createField(Artwork artwork)
                     throws FieldDataInvalidException
Description copied from interface: Tag
Create artwork field based on the data in artwork

Returns:
suitable tagfield for this format that represents the artwork data
Throws:
FieldDataInvalidException

createArtworkField

public TagField createArtworkField(byte[] data,
                                   java.lang.String mimeType)
Create Artwork

Parameters:
data -
mimeType - of the image
Returns:
See Also:
PictureTypes