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.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionpublic abstract void shallowClose()
throws java.io.IOException
java.io.IOExceptionprotected void ensureOpen()
throws java.io.IOException
java.io.IOExceptionpublic abstract void disposeBefore(long pos)
throws java.io.IOException
java.io.IOExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic short getEndian()
public abstract long getFlushPos()
public abstract long getLength()
java.io.IOExceptionpublic abstract long getStreamPointer()
java.io.IOExceptionpublic abstract void reset()
public abstract void seek(long pos)
throws java.io.IOException
java.io.IOExceptionpublic void setWriteStrategy(WriteStrategy strategy)
public abstract void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in interface java.io.DataOutputwrite in class java.io.OutputStreamjava.io.IOExceptionpublic abstract void write(int value)
throws java.io.IOException
write in interface java.io.DataOutputwrite in class java.io.OutputStreamjava.io.IOExceptionpublic final void writeBoolean(boolean value)
throws java.io.IOException
writeBoolean in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeByte(int value)
throws java.io.IOException
writeByte in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeBytes(java.lang.String value)
throws java.io.IOException
writeBytes in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeChar(int value)
throws java.io.IOException
writeChar in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeChars(java.lang.String value)
throws java.io.IOException
writeChars in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeDouble(double value)
throws java.io.IOException
writeDouble in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeFloat(float value)
throws java.io.IOException
writeFloat in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeInt(int value)
throws java.io.IOException
writeInt in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeLong(long value)
throws java.io.IOException
writeLong in interface java.io.DataOutputjava.io.IOExceptionpublic final void writeS15Fixed16Number(float value)
throws java.io.IOException
java.io.IOExceptionpublic final void writeShort(int value)
throws java.io.IOException
writeShort in interface java.io.DataOutputjava.io.IOExceptionpublic abstract void writeToStream(long len)
throws java.io.IOException
java.io.IOExceptionpublic final void writeU16Fixed16Number(float value)
throws java.io.IOException
java.io.IOExceptionpublic final void writeU8Fixed8Number(float value)
throws java.io.IOException
java.io.IOExceptionpublic final void writeUTF(java.lang.String value)
throws java.io.IOException
writeUTF in interface java.io.DataOutputjava.io.IOException