org.jaudiotagger.audio.asf.tag
Class AsfTagCoverField

java.lang.Object
  extended by org.jaudiotagger.audio.asf.tag.AsfTagField
      extended by org.jaudiotagger.audio.asf.tag.AbstractAsfTagImageField
          extended by org.jaudiotagger.audio.asf.tag.AsfTagCoverField
All Implemented Interfaces:
java.lang.Cloneable, TagField

public class AsfTagCoverField
extends AbstractAsfTagImageField

Encapsulates the WM/Pictures provides some convenience methods for decoding the binary data it contains

The value of a WM/Pictures metadata descriptor is as follows:

byte0 Picture Type byte1-4 Length of the image data mime type encoded as UTF-16LE null byte null byte description encoded as UTF-16LE (optional) null byte null byte image data


Field Summary
private  java.lang.String description
          Description
private  int endOfName
          We need this to retrieve the buffered image, if required
private  int imageDataSize
          Image Data Size as read
static java.util.logging.Logger LOGGER
          Logger Object
private  java.lang.String mimeType
          Mimetype of binary
private  int pictureType
          Picture Type
 
Fields inherited from class org.jaudiotagger.audio.asf.tag.AsfTagField
toWrap
 
Constructor Summary
AsfTagCoverField(byte[] imageData, int pictureType, java.lang.String description, java.lang.String mimeType)
          Create New Image Field
AsfTagCoverField(MetadataDescriptor source)
          Creates an instance from a metadata descriptor
 
Method Summary
private  byte[] createRawContent(byte[] data, int pictureType, java.lang.String description, java.lang.String mimeType)
           
 java.lang.String getDescription()
           
 int getImageDataSize()
          Returns the size of the image data.
 java.lang.String getMimeType()
           
 int getPictureType()
           
 byte[] getRawImageData()
          Returns the raw data of the represented image.
private  void processRawContent()
           
 
Methods inherited from class org.jaudiotagger.audio.asf.tag.AbstractAsfTagImageField
getImage
 
Methods inherited from class org.jaudiotagger.audio.asf.tag.AsfTagField
clone, copyContent, getDescriptor, getId, getRawContent, isBinary, isBinary, isCommon, isEmpty, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER

public static final java.util.logging.Logger LOGGER
Logger Object


description

private java.lang.String description
Description


endOfName

private int endOfName
We need this to retrieve the buffered image, if required


imageDataSize

private int imageDataSize
Image Data Size as read


mimeType

private java.lang.String mimeType
Mimetype of binary


pictureType

private int pictureType
Picture Type

Constructor Detail

AsfTagCoverField

public AsfTagCoverField(byte[] imageData,
                        int pictureType,
                        java.lang.String description,
                        java.lang.String mimeType)
Create New Image Field

Parameters:
imageData -
pictureType -
description -
mimeType -

AsfTagCoverField

public AsfTagCoverField(MetadataDescriptor source)
Creates an instance from a metadata descriptor

Parameters:
source - The metadata descriptor, whose content is published.
Method Detail

createRawContent

private byte[] createRawContent(byte[] data,
                                int pictureType,
                                java.lang.String description,
                                java.lang.String mimeType)

getDescription

public java.lang.String getDescription()

getImageDataSize

public int getImageDataSize()
Description copied from class: AbstractAsfTagImageField
Returns the size of the image data.

Specified by:
getImageDataSize in class AbstractAsfTagImageField
Returns:
image data size in bytes.

getMimeType

public java.lang.String getMimeType()

getPictureType

public int getPictureType()

getRawImageData

public byte[] getRawImageData()
Description copied from class: AbstractAsfTagImageField
Returns the raw data of the represented image.

Specified by:
getRawImageData in class AbstractAsfTagImageField
Returns:
the raw image data only

processRawContent

private void processRawContent()
                        throws java.io.UnsupportedEncodingException
Throws:
java.io.UnsupportedEncodingException