org.jaudiotagger.tag.id3.framebody
Class AbstractID3v2FrameBody

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTagFrameBody
          extended by org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody
Direct Known Subclasses:
AbstractFrameBodyTextInfo, AbstractFrameBodyUrlLink, FrameBodyAENC, FrameBodyAPIC, FrameBodyASPI, FrameBodyCHAP, FrameBodyCOMM, FrameBodyCOMR, FrameBodyCRM, FrameBodyCTOC, FrameBodyDeprecated, FrameBodyENCR, FrameBodyEQU2, FrameBodyEQUA, FrameBodyETCO, FrameBodyGEOB, FrameBodyGRID, FrameBodyIPLS, FrameBodyLINK, FrameBodyMCDI, FrameBodyMLLT, FrameBodyOWNE, FrameBodyPCNT, FrameBodyPIC, FrameBodyPOPM, FrameBodyPOSS, FrameBodyPRIV, FrameBodyRBUF, FrameBodyRVA2, FrameBodyRVAD, FrameBodyRVRB, FrameBodySEEK, FrameBodySIGN, FrameBodySYLT, FrameBodySYTC, FrameBodyUFID, FrameBodyUnsupported, FrameBodyUSER, FrameBodyUSLT

public abstract class AbstractID3v2FrameBody
extends AbstractTagFrameBody

Contains the content for an ID3v2 frame, (the header is held directly within the frame


Field Summary
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
logger
 
Method Summary
 void createStructure()
          Return String Representation of Datatype *
 boolean equals(java.lang.Object obj)
          Are two bodies equal
abstract  java.lang.String getIdentifier()
          Return the ID3v2 Frame Identifier, must be implemented by concrete subclasses
 int getSize()
          Return size of frame body,if framebody already exist will take this value from the frame header but it is always recalculated before writing any changes back to disk.
 void read(java.nio.ByteBuffer byteBuffer)
          This reads a frame body from a ByteBuffer into the appropriate FrameBody class and update the position of the buffer to be just after the end of this framebody The ByteBuffer represents the tag and its position should be at the start of this framebody.
 void setSize()
          Set size based on size of the DataTypes making up the body,done after write
 void setSize(int size)
          Set size based on size passed as parameter from frame header, done before read
 void write(java.io.ByteArrayOutputStream tagBuffer)
          Write the contents of this datatype to the byte array
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagFrameBody
getBriefDescription, getHeader, getLongDescription, getObject, getObjectValue, getTextEncoding, isSubsetOf, iterator, setHeader, setObjectValue, setTextEncoding, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getIdentifier

public abstract java.lang.String getIdentifier()
Return the ID3v2 Frame Identifier, must be implemented by concrete subclasses

Specified by:
getIdentifier in class AbstractTagItem
Returns:
the frame identifier

getSize

public int getSize()
Return size of frame body,if framebody already exist will take this value from the frame header but it is always recalculated before writing any changes back to disk.

Overrides:
getSize in class AbstractTagFrameBody
Returns:
size in bytes of this frame body

setSize

public void setSize(int size)
Set size based on size passed as parameter from frame header, done before read


setSize

public void setSize()
Set size based on size of the DataTypes making up the body,done after write


equals

public boolean equals(java.lang.Object obj)
Are two bodies equal

Overrides:
equals in class AbstractTagFrameBody
Parameters:
obj -
Returns:
true if this datatype and its entire MP3Object array list equals the argument.

read

public void read(java.nio.ByteBuffer byteBuffer)
          throws InvalidTagException
This reads a frame body from a ByteBuffer into the appropriate FrameBody class and update the position of the buffer to be just after the end of this framebody The ByteBuffer represents the tag and its position should be at the start of this framebody. The size as indicated in the header is passed to the frame constructor when reading from file.

Specified by:
read in class AbstractTagItem
Parameters:
byteBuffer - file to read
Throws:
InvalidFrameException - if unable to construct a framebody from the ByteBuffer
InvalidTagException

write

public void write(java.io.ByteArrayOutputStream tagBuffer)
Write the contents of this datatype to the byte array

Throws:
java.io.IOException - on any I/O error

createStructure

public void createStructure()
Return String Representation of Datatype *

Overrides:
createStructure in class AbstractTagFrameBody