Coverage Report - org.jaudiotagger.audio.asf.io.WriteableChunk
 
Classes in this File Line Coverage Branch Coverage Complexity
WriteableChunk
N/A
N/A
1
 
 1  
 package org.jaudiotagger.audio.asf.io;
 2  
 
 3  
 import org.jaudiotagger.audio.asf.data.GUID;
 4  
 
 5  
 import java.io.IOException;
 6  
 import java.io.OutputStream;
 7  
 
 8  
 /**
 9  
  * Implementors can write themselves directly to an output stream, and have the
 10  
  * ability to tell the size they would need, as well as determine if they are
 11  
  * empty.<br>
 12  
  * 
 13  
  * @author Christian Laireiter
 14  
  */
 15  
 public interface WriteableChunk {
 16  
 
 17  
     /**
 18  
      * This method calculates the total amount of bytes, the chunk would consume
 19  
      * in an ASF file.<br>
 20  
      * 
 21  
      * @return amount of bytes the chunk would currently need in an ASF file.
 22  
      */
 23  
     long getCurrentAsfChunkSize();
 24  
 
 25  
     /**
 26  
      * Returns the GUID of the chunk.
 27  
      * 
 28  
      * @return GUID of the chunk.
 29  
      */
 30  
     GUID getGuid();
 31  
 
 32  
     /**
 33  
      * <code>true</code> if it is not necessary to write the chunk into an ASF
 34  
      * file, since it contains no information.
 35  
      * 
 36  
      * @return <code>true</code> if no useful data will be preserved.
 37  
      */
 38  
     boolean isEmpty();
 39  
 
 40  
     /**
 41  
      * Writes the chunk into the specified output stream, as ASF stream chunk.<br>
 42  
      * 
 43  
      * @param out
 44  
      *            stream to write into.
 45  
      * @return amount of bytes written.
 46  
      * @throws IOException
 47  
      *             on I/O errors
 48  
      */
 49  
     long writeInto(OutputStream out) throws IOException;
 50  
 }