org.jaudiotagger.audio.asf.data
Class ContentDescription

java.lang.Object
  extended by org.jaudiotagger.audio.asf.data.Chunk
      extended by org.jaudiotagger.audio.asf.data.ContentDescription
All Implemented Interfaces:
WriteableChunk

public class ContentDescription
extends Chunk
implements WriteableChunk

This class represents the data of a chunk which contains title, author, copyright, description and the rating of the file.
It is optional within ASF files. But if, exists only once.

Author:
Christian Laireiter

Constructor Summary
ContentDescription()
          Creates an instance.
ContentDescription(long pos, java.math.BigInteger chunkLen)
          Creates an instance.
 
Method Summary
 java.lang.String getAuthor()
           
 java.lang.String getComment()
           
 java.lang.String getCopyRight()
           
 long getCurrentAsfChunkSize()
          This method calculates the total amount of bytes, the chunk would consume in an ASF file.
 java.lang.String getRating()
           
 java.lang.String getTitle()
           
 boolean isEmpty()
          true if it is not necessary to write the chunk into an ASF file, since it contains no information.
 java.lang.String prettyPrint(java.lang.String prefix)
          This method creates a String containing useful information prepared to be printed on STD-OUT.
 void setAuthor(java.lang.String fileAuthor)
           
 void setComment(java.lang.String tagComment)
           
 void setCopyRight(java.lang.String cpright)
           
 void setRating(java.lang.String ratingText)
           
 void setTitle(java.lang.String songTitle)
           
 long writeInto(java.io.OutputStream out)
          Writes the chunk into the specified output stream, as ASF stream chunk.
 
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
 
Methods inherited from interface org.jaudiotagger.audio.asf.io.WriteableChunk
getGuid
 

Constructor Detail

ContentDescription

public ContentDescription()
Creates an instance.


ContentDescription

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

Parameters:
pos - Position of content description within file or stream
chunkLen - Length of content description.
Method Detail

getAuthor

public java.lang.String getAuthor()
Returns:
Returns the author.

getComment

public java.lang.String getComment()
Returns:
Returns the comment.

getCopyRight

public java.lang.String getCopyRight()
Returns:
Returns the copyRight.

getCurrentAsfChunkSize

public long getCurrentAsfChunkSize()
This method calculates the total amount of bytes, the chunk would consume in an ASF file.

Specified by:
getCurrentAsfChunkSize in interface WriteableChunk
Returns:
amount of bytes the chunk would currently need in an ASF file.

getRating

public java.lang.String getRating()
Returns:
returns the rating.

getTitle

public java.lang.String getTitle()
Returns:
Returns the title.

isEmpty

public boolean isEmpty()
true if it is not necessary to write the chunk into an ASF file, since it contains no information.

Specified by:
isEmpty in interface WriteableChunk
Returns:
true if no useful data will be preserved.

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 Chunk
Parameters:
prefix - each line gets this string prepended.
Returns:
Information of current Chunk Object.

setAuthor

public void setAuthor(java.lang.String fileAuthor)
               throws java.lang.IllegalArgumentException
Parameters:
fileAuthor - The author to set.
Throws:
java.lang.IllegalArgumentException - If "UTF-16LE"-byte-representation would take more than 65535 bytes.

setComment

public void setComment(java.lang.String tagComment)
                throws java.lang.IllegalArgumentException
Parameters:
tagComment - The comment to set.
Throws:
java.lang.IllegalArgumentException - If "UTF-16LE"-byte-representation would take more than 65535 bytes.

setCopyRight

public void setCopyRight(java.lang.String cpright)
                  throws java.lang.IllegalArgumentException
Parameters:
cpright - The copyRight to set.
Throws:
java.lang.IllegalArgumentException - If "UTF-16LE"-byte-representation would take more than 65535 bytes.

setRating

public void setRating(java.lang.String ratingText)
               throws java.lang.IllegalArgumentException
Parameters:
ratingText - The rating to be set.
Throws:
java.lang.IllegalArgumentException - If "UTF-16LE"-byte-representation would take more than 65535 bytes.

setTitle

public void setTitle(java.lang.String songTitle)
              throws java.lang.IllegalArgumentException
Parameters:
songTitle - The title to set.
Throws:
java.lang.IllegalArgumentException - If "UTF-16LE"-byte-representation would take more than 65535 bytes.

writeInto

public long writeInto(java.io.OutputStream out)
               throws java.io.IOException
Writes the chunk into the specified output stream, as ASF stream chunk.

Specified by:
writeInto in interface WriteableChunk
Parameters:
out - stream to write into.
Returns:
amount of bytes written.
Throws:
java.io.IOException - on I/O errors