Coverage Report - org.jaudiotagger.audio.asf.io.RandomAccessFileOutputStream
 
Classes in this File Line Coverage Branch Coverage Complexity
RandomAccessFileOutputStream
71%
5/7
N/A
1
 
 1  
 package org.jaudiotagger.audio.asf.io;
 2  
 
 3  
 import java.io.IOException;
 4  
 import java.io.OutputStream;
 5  
 import java.io.RandomAccessFile;
 6  
 
 7  
 /**
 8  
  * Wraps a {@link RandomAccessFile} into an {@link OutputStream}.<br>
 9  
  * 
 10  
  * @author Christian Laireiter
 11  
  */
 12  
 public final class RandomAccessFileOutputStream extends OutputStream {
 13  
 
 14  
     /**
 15  
      * the file to write to.
 16  
      */
 17  
     private final RandomAccessFile targetFile;
 18  
 
 19  
     /**
 20  
      * Creates an instance.<br>
 21  
      * 
 22  
      * @param target
 23  
      *            file to write to.
 24  
      */
 25  
     public RandomAccessFileOutputStream(final RandomAccessFile target) {
 26  133
         super();
 27  133
         this.targetFile = target;
 28  133
     }
 29  
 
 30  
     /**
 31  
      * {@inheritDoc}
 32  
      */
 33  
     @Override
 34  
     public void write(final byte[] bytes, final int off, final int len)
 35  
             throws IOException {
 36  16653
         this.targetFile.write(bytes, off, len);
 37  16653
     }
 38  
 
 39  
     /**
 40  
      * {@inheritDoc}
 41  
      */
 42  
     @Override
 43  
     public void write(final int toWrite) throws IOException {
 44  0
         this.targetFile.write(toWrite);
 45  0
     }
 46  
 
 47  
 }