org.jaudiotagger.audio.asf.data
Class AsfHeader

java.lang.Object
  extended by org.jaudiotagger.audio.asf.data.Chunk
      extended by org.jaudiotagger.audio.asf.data.ChunkContainer
          extended by org.jaudiotagger.audio.asf.data.AsfHeader

public final class AsfHeader
extends ChunkContainer

Each ASF file starts with a so called header.
This header contains other chunks. Each chunk starts with a 16 byte GUID followed by the length (in bytes) of the chunk (including GUID). The length number takes 8 bytes and is unsigned. Finally the chunk's data appears.

Author:
Christian Laireiter

Field Summary
static java.nio.charset.Charset ASF_CHARSET
          The charset "UTF-16LE" is mandatory for ASF handling.
static byte[] ZERO_TERM
          Byte sequence representing the zero term character.
 
Constructor Summary
AsfHeader(long pos, java.math.BigInteger chunkLen, long chunkCnt)
          Creates an instance.
 
Method Summary
 ContentDescription findContentDescription()
          This method looks for an content description object in this header instance, if not found there, it tries to get one from a contained ASF header extension object.
 ExtendedContentDescription findExtendedContentDescription()
          This method looks for an extended content description object in this header instance, if not found there, it tries to get one from a contained ASF header extension object.
 AudioStreamChunk getAudioStreamChunk()
          This method returns the first audio stream chunk found in the asf file or stream.
 long getChunkCount()
          Returns the amount of chunks, when this instance was created.
If chunks have been added, this won't be reflected with this call.
For that use ChunkContainer.getChunks().
 ContentDescription getContentDescription()
           
 EncodingChunk getEncodingChunk()
           
 EncryptionChunk getEncryptionChunk()
           
 ExtendedContentDescription getExtendedContentDescription()
           
 AsfExtendedHeader getExtendedHeader()
           
 FileHeader getFileHeader()
           
 StreamBitratePropertiesChunk getStreamBitratePropertiesChunk()
           
 java.lang.String prettyPrint(java.lang.String prefix)
          This method creates a String containing useful information prepared to be printed on STD-OUT.
This method is intended to be overwritten by inheriting classes.
 
Methods inherited from class org.jaudiotagger.audio.asf.data.ChunkContainer
addChunk, getChunks, prettyPrint
 
Methods inherited from class org.jaudiotagger.audio.asf.data.Chunk
getChunckEnd, getChunkLength, getGuid, getPosition, setPosition, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ASF_CHARSET

public static final java.nio.charset.Charset ASF_CHARSET
The charset "UTF-16LE" is mandatory for ASF handling.


ZERO_TERM

public static final byte[] ZERO_TERM
Byte sequence representing the zero term character.

Constructor Detail

AsfHeader

public AsfHeader(long pos,
                 java.math.BigInteger chunkLen,
                 long chunkCnt)
Creates an instance.

Parameters:
pos - see Chunk.position
chunkLen - see Chunk.chunkLength
chunkCnt -
Method Detail

findContentDescription

public ContentDescription findContentDescription()
This method looks for an content description object in this header instance, if not found there, it tries to get one from a contained ASF header extension object.

Returns:
content description if found, null otherwise.

findExtendedContentDescription

public ExtendedContentDescription findExtendedContentDescription()
This method looks for an extended content description object in this header instance, if not found there, it tries to get one from a contained ASF header extension object.

Returns:
extended content description if found, null otherwise.

getAudioStreamChunk

public AudioStreamChunk getAudioStreamChunk()
This method returns the first audio stream chunk found in the asf file or stream.

Returns:
Returns the audioStreamChunk.

getChunkCount

public long getChunkCount()
Returns the amount of chunks, when this instance was created.
If chunks have been added, this won't be reflected with this call.
For that use ChunkContainer.getChunks().

Returns:
Chunkcount at instance creation.

getContentDescription

public ContentDescription getContentDescription()
Returns:
Returns the contentDescription.

getEncodingChunk

public EncodingChunk getEncodingChunk()
Returns:
Returns the encodingChunk.

getEncryptionChunk

public EncryptionChunk getEncryptionChunk()
Returns:
Returns the encodingChunk.

getExtendedContentDescription

public ExtendedContentDescription getExtendedContentDescription()
Returns:
Returns the tagHeader.

getExtendedHeader

public AsfExtendedHeader getExtendedHeader()
Returns:
Returns the extended header.

getFileHeader

public FileHeader getFileHeader()
Returns:
Returns the fileHeader.

getStreamBitratePropertiesChunk

public StreamBitratePropertiesChunk getStreamBitratePropertiesChunk()
Returns:
Returns the streamBitratePropertiesChunk.

prettyPrint

public java.lang.String prettyPrint(java.lang.String prefix)
This method creates a String containing useful information prepared to be printed on STD-OUT.
This method is intended to be overwritten by inheriting classes.

Overrides:
prettyPrint in class ChunkContainer
Parameters:
prefix - each line gets this string prepended.
Returns:
Information of current Chunk Object.