FileDocCategorySizeDatePackage
ContentBrandingReader.javaAPI DocJaudiotagger 2.0.42411Wed Mar 30 16:11:50 BST 2011org.jaudiotagger.audio.asf.io

ContentBrandingReader

public class ContentBrandingReader extends Object implements ChunkReader
This reader is used to read the content branding object of ASF streams.
see
org.jaudiotagger.audio.asf.data.ContainerType#CONTENT_BRANDING
see
ContentBranding
author
Christian Laireiter

Fields Summary
private static final org.jaudiotagger.audio.asf.data.GUID[]
APPLYING
The GUID this reader {@linkplain #getApplyingIds() applies to}
Constructors Summary
protected ContentBrandingReader()
Should not be used for now.


               
      
        // NOTHING toDo
    
Methods Summary
public booleancanFail()
{@inheritDoc}

        return false;
    
public org.jaudiotagger.audio.asf.data.GUID[]getApplyingIds()
{@inheritDoc}

        return APPLYING.clone();
    
public org.jaudiotagger.audio.asf.data.Chunkread(org.jaudiotagger.audio.asf.data.GUID guid, java.io.InputStream stream, long streamPosition)
{@inheritDoc}

        assert GUID.GUID_CONTENT_BRANDING.equals(guid);
        final BigInteger chunkSize = Utils.readBig64(stream);
        final long imageType = Utils.readUINT32(stream);
        assert imageType >= 0 && imageType <= 3 : imageType;
        final long imageDataSize = Utils.readUINT32(stream);
        assert imageType > 0 || imageDataSize == 0 : imageDataSize;
        assert imageDataSize < Integer.MAX_VALUE;
        final byte[] imageData = Utils.readBinary(stream, imageDataSize);
        final long copyRightUrlLen = Utils.readUINT32(stream);
        final String copyRight = new String(Utils.readBinary(stream,
                copyRightUrlLen));
        final long imageUrlLen = Utils.readUINT32(stream);
        final String imageUrl = new String(Utils
                .readBinary(stream, imageUrlLen));
        final ContentBranding result = new ContentBranding(streamPosition,
                chunkSize);
        result.setImage(imageType, imageData);
        result.setCopyRightURL(copyRight);
        result.setBannerImageURL(imageUrl);
        return result;