com.softsynth.util
Class RandomOutputStream
java.lang.Object
java.io.OutputStream
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).
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 |
RandomOutputStream
public RandomOutputStream(java.io.RandomAccessFile randomFile)
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