org.entityfs.util.io
Class RandomAccessToOutputStreamAdapter
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.entityfs.util.io.RandomAccessToOutputStreamAdapter
- All Implemented Interfaces:
- Closeable, Flushable
public class RandomAccessToOutputStreamAdapter
- extends FilterOutputStream
This adapter treats a RandomAccess
as an OutputStream
.
- Since:
- 1.0
- Author:
- Karl Gustafsson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomAccessToOutputStreamAdapter
public RandomAccessToOutputStreamAdapter(RandomAccess ra)
- Create an adapter between a
RandomAccess
and an
OutputStream
.
When this adapter is closed, it closes the underlying RandomAccess
object. See
RandomAccessToOutputStreamAdapter(RandomAccess, boolean)
- Parameters:
ra
- The RandomAccess
to adapt.
RandomAccessToOutputStreamAdapter
public RandomAccessToOutputStreamAdapter(RandomAccess ra,
boolean closeRandomAccessWhenClosingStream)
- Create an adapter between a
RandomAccess
and an
OutputStream
.
- Parameters:
ra
- The RandomAccess
to adapt.closeRandomAccessWhenClosingStream
- Should the RandomAccess
be closed when this stream is closed?
write
public void write(byte[] barr)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
write
public void write(byte[] barr,
int off,
int len)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
write
public void write(int b)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
flush
public void flush()
throws IOException
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class FilterOutputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class FilterOutputStream
- Throws:
IOException