org.blinkenlights.jid3.v2
Class APICID3V2Frame

java.lang.Object
  extended byorg.blinkenlights.jid3.v2.ID3V2Frame
      extended byorg.blinkenlights.jid3.v2.APICID3V2Frame
All Implemented Interfaces:
ID3Subject, ID3Visitable

public class APICID3V2Frame
extends ID3V2Frame


Nested Class Summary
static class APICID3V2Frame.PictureType
           
 
Constructor Summary
APICID3V2Frame(java.io.InputStream oIS)
           
APICID3V2Frame(java.lang.String sMimeType, APICID3V2Frame.PictureType oPictureType, java.lang.String sDescription, byte[] abyPictureData)
          Constructor.
 
Method Summary
 void accept(ID3Visitor oID3Visitor)
          Accept a visitor.
 boolean equals(java.lang.Object oOther)
           
 java.lang.String getDescription()
          Get the description for the picture in this frame.
protected  byte[] getFrameId()
          Get the four bytes which uniquely specify of which type this frame is.
 java.lang.String getMimeType()
          Get the MIME type of the image contained in this frame.
 byte[] getPictureData()
          Get the picture data for the image in this frame.
 APICID3V2Frame.PictureType getPictureType()
          Get the classification of the picture in this frame.
 TextEncoding getTextEncoding()
          Get the text encoding used for the description in this frame.
 void setDescription(java.lang.String sDescription)
          Set the description for the picture in this frame.
 void setMimeType(java.lang.String sMimeType)
          Set the MIME type for the image contained in this frame.
 void setPictureData(byte[] abyPictureData)
          Set the picture data for the image in this frame.
 void setPictureType(APICID3V2Frame.PictureType oPictureType)
          Set the classification of the picture in this frame.
 void setTextEncoding(TextEncoding oTextEncoding)
          Set the text encoding to be used for the description in this frame.
 java.lang.String toString()
          Represent the contents of this frame as a string.
protected  void writeBody(ID3DataOutputStream oIDOS)
          Write the body of the frame to an ID3 data output stream.
 
Methods inherited from class org.blinkenlights.jid3.v2.ID3V2Frame
addID3Observer, getEncryptionMethod, isEncrypted, notifyID3Observers, removeID3Observer, setCompressionFlag, setEncryption, setFileAlterPreservationFlag, setGroupingIdentityFlag, setReadOnlyFlag, setTagAlterPreservationFlag, write, writeHeader
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

APICID3V2Frame

public APICID3V2Frame(java.lang.String sMimeType,
                      APICID3V2Frame.PictureType oPictureType,
                      java.lang.String sDescription,
                      byte[] abyPictureData)
               throws ID3Exception
Constructor. Note: It is valid to set the MIME type to "-->", and set the picture data to an URL pointing to the image, although this is discouraged.

Parameters:
sMimeType - the valid MIME type (ie. image/png) describing the format of the contained image (the default if null is specified is "image/")
oPictureType - the classification of the picture attached
sDescription - an optional description of the image, or null if no description required
abyPictureData - the data content of the image
Throws:
ID3Exception - if the description is longer than 64 characters
ID3Exception - if the picture data is null, or zero length

APICID3V2Frame

public APICID3V2Frame(java.io.InputStream oIS)
               throws ID3Exception
Method Detail

accept

public void accept(ID3Visitor oID3Visitor)
Description copied from interface: ID3Visitable
Accept a visitor.

Parameters:
oID3Visitor - a visitor of this object

setMimeType

public void setMimeType(java.lang.String sMimeType)
Set the MIME type for the image contained in this frame. Note: It is valid to set the MIME type to "-->", and set the picture data to an URL pointing to the image, although this is discouraged.

Parameters:
sMimeType - the valid MIME type (ie. image/png) describing the format of the contained image (the default if null is specified is "image/")

getMimeType

public java.lang.String getMimeType()
Get the MIME type of the image contained in this frame. A MIME type of "-->" implies that the image data contains an URL reference to the actual image data.

Returns:
the specified MIME type

setPictureType

public void setPictureType(APICID3V2Frame.PictureType oPictureType)
Set the classification of the picture in this frame.

Parameters:
oPictureType - the type of the picture in this frame.

getPictureType

public APICID3V2Frame.PictureType getPictureType()
Get the classification of the picture in this frame.

Returns:
the type of the picture in this frame

setDescription

public void setDescription(java.lang.String sDescription)
                    throws ID3Exception
Set the description for the picture in this frame.

Parameters:
sDescription - an optional description of the image, or null if no description required
Throws:
ID3Exception - if the description is longer than 64 characters
ID3Exception - if this frame is in a tag with another APIC frame which would have the same description

getDescription

public java.lang.String getDescription()
Get the description for the picture in this frame.

Returns:
the set description, or null if no description has been defined

setPictureData

public void setPictureData(byte[] abyPictureData)
                    throws ID3Exception
Set the picture data for the image in this frame.

Parameters:
abyPictureData - the data content of the image
Throws:
ID3Exception - if the picture data is null, or zero length

getPictureData

public byte[] getPictureData()
Get the picture data for the image in this frame.

Returns:
the picture data for the image

setTextEncoding

public void setTextEncoding(TextEncoding oTextEncoding)
Set the text encoding to be used for the description in this frame.

Parameters:
oTextEncoding - the text encoding to be used for this frame

getTextEncoding

public TextEncoding getTextEncoding()
Get the text encoding used for the description in this frame.

Returns:
the text encoding to be used for this frame

getFrameId

protected byte[] getFrameId()
Description copied from class: ID3V2Frame
Get the four bytes which uniquely specify of which type this frame is.

Specified by:
getFrameId in class ID3V2Frame

toString

public java.lang.String toString()
Description copied from class: ID3V2Frame
Represent the contents of this frame as a string. For debugging purposes.

Specified by:
toString in class ID3V2Frame
Returns:
a string representing this frame

writeBody

protected void writeBody(ID3DataOutputStream oIDOS)
                  throws java.io.IOException
Description copied from class: ID3V2Frame
Write the body of the frame to an ID3 data output stream.

Specified by:
writeBody in class ID3V2Frame
Parameters:
oIDOS - the output stream to write to
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object oOther)