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 ability to tell the size
 10  
  * they would need, as well as determine if they are empty.<rbr>
 11  
  * 
 12  
  * @author Christian Laireiter
 13  
  */
 14  
 public interface WriteableChunk
 15  
 {
 16  
 
 17  
 
 18  
     /**
 19  
      * This method calculates the total amount of bytes, the chunk would consume in an ASF file.<br>
 20  
      * 
 21  
      * @return amount of bytes the chunk would currently need in an ASF file.
 22  
      */
 23  
     public long getCurrentAsfChunkSize();
 24  
 
 25  
     /**
 26  
      * Returns the GUID of the chunk. 
 27  
      * 
 28  
      * @return GUID of the chunk.
 29  
      */
 30  
     public GUID getGuid();
 31  
 
 32  
     /**
 33  
      * <code>true</code> if it is not necessary to write the chunk into an ASF file, since it contains no information.
 34  
      * 
 35  
      * @return <code>true</code> if no useful data will be preserved.
 36  
      */
 37  
     public boolean isEmpty();
 38  
 
 39  
     /**
 40  
      * Writes the chunk into the specified output stream, as ASF stream chunk.<br>
 41  
      * 
 42  
      * @param out stream to write into.
 43  
      * @return amount of bytes written.
 44  
      * @throws IOException on I/O errors
 45  
      */
 46  
     public long writeInto(OutputStream out) throws IOException;
 47  
 }