org.jaudiotagger.audio.asf.data
Class Chunk

java.lang.Object
  extended by org.jaudiotagger.audio.asf.data.Chunk
Direct Known Subclasses:
ChunkContainer, ContentDescription, EncodingChunk, EncryptionChunk, ExtendedContentDescription, FileHeader, StreamBitratePropertiesChunk, StreamChunk

public class Chunk
extends java.lang.Object

This class represents a chunk within ASF streams.
Each chunk starts with a 16byte GUID identifying the type. After that a number (represented by 8 bytes) follows which shows the size in bytes of the chunk. Finally there is the data of the chunk.

Author:
Christian Laireiter

Constructor Summary
Chunk(GUID headerGuid, java.math.BigInteger chunkLen)
          Creates an instance
Chunk(GUID headerGuid, long pos, java.math.BigInteger chunkLen)
          Creates an instance
 
Method Summary
 long getChunckEnd()
          This method returns the End of the current chunk introduced by current header object.
 java.math.BigInteger getChunkLength()
           
 GUID getGuid()
           
 long getPosition()
           
 java.lang.String prettyPrint(java.lang.String prefix)
          This method creates a String containing useful information prepared to be printed on STD-OUT.
 void setPosition(long pos)
          Sets the position.
 java.lang.String toString()
          (overridden)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Chunk

public Chunk(GUID headerGuid,
             java.math.BigInteger chunkLen)
Creates an instance

Parameters:
headerGuid - The GUID of header object.
chunkLen - Length of current chunk.

Chunk

public Chunk(GUID headerGuid,
             long pos,
             java.math.BigInteger chunkLen)
Creates an instance

Parameters:
headerGuid - The GUID of header object.
pos - Position of header object within stream or file.
chunkLen - Length of current chunk.
Method Detail

getChunckEnd

public long getChunckEnd()
This method returns the End of the current chunk introduced by current header object.

Returns:
Position after current chunk.

getChunkLength

public java.math.BigInteger getChunkLength()
Returns:
Returns the chunkLength.

getGuid

public GUID getGuid()
Returns:
Returns the guid.

getPosition

public long getPosition()
Returns:
Returns the position.

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.

Parameters:
prefix - each line gets this string prepended.
Returns:
Information of current Chunk Object.

setPosition

public void setPosition(long pos)
Sets the position.

Parameters:
pos - position to set.

toString

public java.lang.String toString()
(overridden)

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()