org.jaudiotagger.audio.asf.data
Class ContentBranding

java.lang.Object
  extended by org.jaudiotagger.audio.asf.data.Chunk
      extended by org.jaudiotagger.audio.asf.data.MetadataContainer
          extended by org.jaudiotagger.audio.asf.data.ContentBranding
All Implemented Interfaces:
WriteableChunk

public final class ContentBranding
extends MetadataContainer

This structure represents the value of the content branding object, which stores the banner image, the banner image URL and the copyright URL.

Author:
Christian Laireiter

Field Summary
static java.util.Set<java.lang.String> ALLOWED
          Stores the allowed descriptor keys.
static java.lang.String KEY_BANNER_IMAGE
          Descriptor key representing the banner image.
static java.lang.String KEY_BANNER_TYPE
          Descriptor key representing the banner image type.

Known/valid values are: 0: there is no image present 1: there is a BMP image 2: there is a JPEG image 3: there is a GIF image
static java.lang.String KEY_BANNER_URL
          Descriptor key representing the banner image URL.
static java.lang.String KEY_COPYRIGHT_URL
          Descriptor key representing the copyright URL.
 
Fields inherited from class org.jaudiotagger.audio.asf.data.Chunk
chunkLength, guid, position
 
Constructor Summary
ContentBranding()
          Creates an instance.
ContentBranding(long pos, java.math.BigInteger size)
          Creates an instance.
 
Method Summary
 java.lang.String getBannerImageURL()
          Returns the banner image URL.
 java.lang.String getCopyRightURL()
          Returns the copyright URL.
 long getCurrentAsfChunkSize()
          This method calculates the total amount of bytes, the chunk would consume in an ASF file.
 byte[] getImageData()
          Returns the binary image data.
 long getImageType()
          Returns the image type.
 boolean isAddSupported(MetadataDescriptor descriptor)
          Determines/checks if the given descriptor may be added to the container.
This implies a check for the capabilities of the container specified by its container type.
 void setBannerImageURL(java.lang.String imageURL)
          This method sets the banner image URL, if imageURL is not blank.
 void setCopyRightURL(java.lang.String copyRight)
          This method sets the copyright URL, if copyRight is not blank.
 void setImage(long imageType, byte[] imageData)
           
 long writeInto(java.io.OutputStream out)
          Writes the chunk into the specified output stream, as ASF stream chunk.
 
Methods inherited from class org.jaudiotagger.audio.asf.data.MetadataContainer
addDescriptor, assertDescriptor, assertDescriptor, containsDescriptor, getContainerType, getDescriptorCount, getDescriptors, getDescriptorsByName, getValueFor, hasDescriptor, isEmpty, prettyPrint, removeDescriptorsByName, setStringValue
 
Methods inherited from class org.jaudiotagger.audio.asf.data.Chunk
getChunckEnd, getChunkEnd, getChunkLength, getGuid, getPosition, setPosition, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jaudiotagger.audio.asf.io.WriteableChunk
getGuid
 

Field Detail

ALLOWED

public static final java.util.Set<java.lang.String> ALLOWED
Stores the allowed descriptor keys.


KEY_BANNER_IMAGE

public static final java.lang.String KEY_BANNER_IMAGE
Descriptor key representing the banner image.

See Also:
Constant Field Values

KEY_BANNER_TYPE

public static final java.lang.String KEY_BANNER_TYPE
Descriptor key representing the banner image type.

Known/valid values are:
  1. 0: there is no image present
  2. 1: there is a BMP image
  3. 2: there is a JPEG image
  4. 3: there is a GIF image

See Also:
Constant Field Values

KEY_BANNER_URL

public static final java.lang.String KEY_BANNER_URL
Descriptor key representing the banner image URL.

See Also:
Constant Field Values

KEY_COPYRIGHT_URL

public static final java.lang.String KEY_COPYRIGHT_URL
Descriptor key representing the copyright URL.

See Also:
Constant Field Values
Constructor Detail

ContentBranding

public ContentBranding()
Creates an instance.


ContentBranding

public ContentBranding(long pos,
                       java.math.BigInteger size)
Creates an instance.

Parameters:
pos - Position of content description within file or stream
size - Length of content description.
Method Detail

getBannerImageURL

public java.lang.String getBannerImageURL()
Returns the banner image URL.

Returns:
the banner image URL.

getCopyRightURL

public java.lang.String getCopyRightURL()
Returns the copyright URL.

Returns:
the banner image URL.

getCurrentAsfChunkSize

public long getCurrentAsfChunkSize()
This method calculates the total amount of bytes, the chunk would consume in an ASF file.

Specified by:
getCurrentAsfChunkSize in interface WriteableChunk
Overrides:
getCurrentAsfChunkSize in class MetadataContainer
Returns:
amount of bytes the chunk would currently need in an ASF file.

getImageData

public byte[] getImageData()
Returns the binary image data.

Returns:
binary image data.

getImageType

public long getImageType()
Returns the image type.

Returns:
image type
See Also:
for known/valid values.

isAddSupported

public boolean isAddSupported(MetadataDescriptor descriptor)
Determines/checks if the given descriptor may be added to the container.
This implies a check for the capabilities of the container specified by its container type.

Overrides:
isAddSupported in class MetadataContainer
Parameters:
descriptor - the descriptor to test.
Returns:
true if MetadataContainer.addDescriptor(MetadataDescriptor) can be called with given descriptor.

setBannerImageURL

public void setBannerImageURL(java.lang.String imageURL)
This method sets the banner image URL, if imageURL is not blank.

Parameters:
imageURL - image URL to set.

setCopyRightURL

public void setCopyRightURL(java.lang.String copyRight)
This method sets the copyright URL, if copyRight is not blank.

Parameters:
copyRight - copyright URL to set.

setImage

public void setImage(long imageType,
                     byte[] imageData)
Parameters:
imageType -
imageData -

writeInto

public long writeInto(java.io.OutputStream out)
               throws java.io.IOException
Writes the chunk into the specified output stream, as ASF stream chunk.

Specified by:
writeInto in interface WriteableChunk
Overrides:
writeInto in class MetadataContainer
Parameters:
out - stream to write into.
Returns:
amount of bytes written.
Throws:
java.io.IOException - on I/O errors