Coverage Report - org.jaudiotagger.audio.asf.io.RandomAccessFileOutputStream
 
Classes in this File Line Coverage Branch Coverage Complexity
RandomAccessFileOutputStream
71%
5/7
N/A
0
 
 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  25
         public RandomAccessFileOutputStream(RandomAccessFile target) {
 26  25
                 this.targetFile = target;
 27  25
         }
 28  
 
 29  
         /**
 30  
          * {@inheritDoc}
 31  
          */
 32  
         @Override
 33  
         public void write(byte[] b, int off, int len) throws IOException {
 34  3000
                 this.targetFile.write(b, off, len);
 35  3000
         }
 36  
 
 37  
         /**
 38  
          * {@inheritDoc}
 39  
          */
 40  
         @Override
 41  
         public void write(int b) throws IOException {
 42  0
                 this.targetFile.write(b);
 43  0
         }
 44  
 
 45  
 }