public abstract class RandomAccessOutputStream
extends java.io.OutputStream
implements java.io.DataOutput
To make it flexible, this class and any of its sub-class doesn't close the underlying stream. It's up to the underlying stream creator to close them. This ensures the actual stream out-lives the random stream itself in case we need to write more content to the underlying stream.
Modifier and Type | Field and Description |
---|---|
protected boolean |
closed |
protected java.io.OutputStream |
dist
The destination stream.
|
Modifier | Constructor and Description |
---|---|
protected |
RandomAccessOutputStream(java.io.OutputStream dist) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
abstract void |
disposeBefore(long pos) |
protected void |
ensureOpen()
Check to make sure that this stream has not been closed
|
protected void |
finalize() |
short |
getEndian() |
abstract long |
getFlushPos() |
abstract long |
getLength()
Returns the total length of data that has been cached,
regardless of whether any early blocks have been disposed.
|
abstract long |
getStreamPointer() |
abstract void |
reset()
Reset this stream to be used again
|
abstract void |
seek(long pos) |
void |
setWriteStrategy(WriteStrategy strategy) |
abstract void |
shallowClose()
Closes the RandomAccessInputStream and it's underlying stream
|
abstract void |
write(byte[] b,
int off,
int len) |
abstract void |
write(int value) |
void |
writeBoolean(boolean value) |
void |
writeByte(int value) |
void |
writeBytes(java.lang.String value) |
void |
writeChar(int value) |
void |
writeChars(java.lang.String value) |
void |
writeDouble(double value) |
void |
writeFloat(float value) |
void |
writeInt(int value) |
void |
writeLong(long value) |
void |
writeS15Fixed16Number(float value) |
void |
writeShort(int value) |
abstract void |
writeToStream(long len) |
void |
writeU16Fixed16Number(float value) |
void |
writeU8Fixed8Number(float value) |
void |
writeUTF(java.lang.String value) |
protected java.io.OutputStream dist
protected boolean closed
protected RandomAccessOutputStream(java.io.OutputStream dist)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public abstract void shallowClose() throws java.io.IOException
java.io.IOException
protected void ensureOpen() throws java.io.IOException
java.io.IOException
public abstract void disposeBefore(long pos) throws java.io.IOException
java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public short getEndian()
public abstract long getFlushPos()
public abstract long getLength()
java.io.IOException
public abstract long getStreamPointer()
java.io.IOException
public abstract void reset()
public abstract void seek(long pos) throws java.io.IOException
java.io.IOException
public void setWriteStrategy(WriteStrategy strategy)
public abstract void write(byte[] b, int off, int len) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.OutputStream
java.io.IOException
public abstract void write(int value) throws java.io.IOException
write
in interface java.io.DataOutput
write
in class java.io.OutputStream
java.io.IOException
public final void writeBoolean(boolean value) throws java.io.IOException
writeBoolean
in interface java.io.DataOutput
java.io.IOException
public final void writeByte(int value) throws java.io.IOException
writeByte
in interface java.io.DataOutput
java.io.IOException
public final void writeBytes(java.lang.String value) throws java.io.IOException
writeBytes
in interface java.io.DataOutput
java.io.IOException
public final void writeChar(int value) throws java.io.IOException
writeChar
in interface java.io.DataOutput
java.io.IOException
public final void writeChars(java.lang.String value) throws java.io.IOException
writeChars
in interface java.io.DataOutput
java.io.IOException
public final void writeDouble(double value) throws java.io.IOException
writeDouble
in interface java.io.DataOutput
java.io.IOException
public final void writeFloat(float value) throws java.io.IOException
writeFloat
in interface java.io.DataOutput
java.io.IOException
public final void writeInt(int value) throws java.io.IOException
writeInt
in interface java.io.DataOutput
java.io.IOException
public final void writeLong(long value) throws java.io.IOException
writeLong
in interface java.io.DataOutput
java.io.IOException
public final void writeS15Fixed16Number(float value) throws java.io.IOException
java.io.IOException
public final void writeShort(int value) throws java.io.IOException
writeShort
in interface java.io.DataOutput
java.io.IOException
public abstract void writeToStream(long len) throws java.io.IOException
java.io.IOException
public final void writeU16Fixed16Number(float value) throws java.io.IOException
java.io.IOException
public final void writeU8Fixed8Number(float value) throws java.io.IOException
java.io.IOException
public final void writeUTF(java.lang.String value) throws java.io.IOException
writeUTF
in interface java.io.DataOutput
java.io.IOException