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

EncodingChunkReader

public class EncodingChunkReader extends Object implements ChunkReader
This class reads the chunk containing encoding data
Warning:
Implementation is not completed. More analysis of this chunk is needed.
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 EncodingChunkReader()
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 EncodingChunk result = new EncodingChunk(chunkLen);
        int readBytes = 24;
        // Can't be interpreted
        /*
         * What do I think of this data, well it seems to be another GUID. Then
         * followed by a UINT16 indicating a length of data following (by half).
         * My test files just had the length of one and a two bytes zero.
         */
        stream.skip(20);
        readBytes += 20;

        /*
         * Read the number of strings which will follow
         */
        final int stringCount = Utils.readUINT16(stream);
        readBytes += 2;

        /*
         * Now reading the specified amount of strings.
         */
        for (int i = 0; i < stringCount; i++) {
            final String curr = Utils.readCharacterSizedString(stream);
            result.addString(curr);
            readBytes += 4 + 2 * curr.length();
        }
        stream.skip(chunkLen.longValue() - readBytes);
        result.setPosition(chunkStart);
        return result;