com.softsynth.util
Class RandomOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by com.softsynth.util.RandomOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
WAVFileWriter

public class RandomOutputStream
extends java.io.OutputStream

An OutputStream wrapper for a RandomAccessFile Needed by routines that output to an OutputStream.

Note that if you are overwriting a RandomAccessFile then you should clear it before you start. This will prevent having the remainder of a longer file stuck at the end of a short file. In Java 1.2 you can call setLength(0).


Constructor Summary
RandomOutputStream(java.io.RandomAccessFile randomFile)
           
 
Method Summary
 long getFilePointer()
           
 void seek(long position)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
close, flush
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomOutputStream

public RandomOutputStream(java.io.RandomAccessFile randomFile)
Method Detail

write

public void write(int b)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

seek

public void seek(long position)
          throws java.io.IOException
Throws:
java.io.IOException

getFilePointer

public long getFilePointer()
                    throws java.io.IOException
Throws:
java.io.IOException