org.jaudiotagger.audio.asf.io
Interface ChunkReader

All Known Implementing Classes:
AsfExtHeaderReader, AsfHeaderReader, ChunkContainerReader, ChunkHeaderReader, ContentBrandingReader, ContentDescriptionReader, EncodingChunkReader, EncryptionChunkReader, FileHeaderReader, LanguageListReader, MetadataReader, StreamBitratePropertiesReader, StreamChunkReader

public interface ChunkReader

A ChunkReader provides methods for reading an ASF chunk.

Author:
Christian Laireiter

Method Summary
 boolean canFail()
          Tells whether the reader can fail to return a valid chunk.
The current Use would be a modified version of StreamChunkReader, which is configured to only manage audio streams.
 GUID[] getApplyingIds()
          Returns the GUIDs identifying the types of chunk, this reader will parse.
 Chunk read(GUID guid, java.io.InputStream stream, long streamPosition)
          Parses the chunk.
 

Method Detail

canFail

boolean canFail()
Tells whether the reader can fail to return a valid chunk.
The current Use would be a modified version of StreamChunkReader, which is configured to only manage audio streams. However, the primary GUID for audio and video streams is the same. So if a stream shows itself to be a video stream, the reader would return null.

Returns:
true, if further analysis of the chunk can show, that the reader is not applicable, despite the header GUID identification told it can handle the chunk.

getApplyingIds

GUID[] getApplyingIds()
Returns the GUIDs identifying the types of chunk, this reader will parse.

Returns:
the GUIDs identifying the types of chunk, this reader will parse.

read

Chunk read(GUID guid,
           java.io.InputStream stream,
           long streamPosition)
           throws java.io.IOException
Parses the chunk.

Parameters:
guid - the GUID of the chunks header, which is about to be read.
stream - source to read chunk from.
No GUID is expected at the currents stream position. The length of the chunk is about to follow.
streamPosition - the position in stream, the chunk starts.
Returns:
the read chunk. (Mostly a subclass of Chunk).
Throws:
java.io.IOException - On I/O Errors.