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

StreamBitratePropertiesReader

public class StreamBitratePropertiesReader extends Object implements ChunkReader
This class reads the chunk containing the stream bitrate properties.
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 StreamBitratePropertiesReader()
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 chunkStart)
{@inheritDoc}

        final BigInteger chunkLen = Utils.readBig64(stream);
        final StreamBitratePropertiesChunk result = new StreamBitratePropertiesChunk(
                chunkLen);

        /*
         * Read the amount of bitrate records
         */
        final long recordCount = Utils.readUINT16(stream);
        for (int i = 0; i < recordCount; i++) {
            final int flags = Utils.readUINT16(stream);
            final long avgBitrate = Utils.readUINT32(stream);
            result.addBitrateRecord(flags & 0x00FF, avgBitrate);
        }

        result.setPosition(chunkStart);

        return result;