Package pixy.io
Class MemoryCacheRandomAccessOutputStream
java.lang.Object
java.io.OutputStream
pixy.io.RandomAccessOutputStream
pixy.io.MemoryCacheRandomAccessOutputStream
- All Implemented Interfaces:
java.io.Closeable,java.io.DataOutput,java.io.Flushable,java.lang.AutoCloseable
public class MemoryCacheRandomAccessOutputStream extends RandomAccessOutputStream
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MemoryCacheRandomAccessOutputStream(java.io.OutputStream dist) -
Method Summary
Modifier and Type Method Description voidclose()voiddisposeBefore(long pos)longgetFlushPos()longgetLength()Returns the total length of data that has been cached, regardless of whether any early blocks have been disposed.longgetStreamPointer()voidreset()Reset this stream to be used againvoidseek(long pos)voidshallowClose()Closes the RandomAccessInputStream and it's underlying streamvoidwrite(byte[] b, int off, int len)voidwrite(int value)voidwriteToStream(long len)Methods inherited from class pixy.io.RandomAccessOutputStream
ensureOpen, finalize, getEndian, setWriteStrategy, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeS15Fixed16Number, writeShort, writeU16Fixed16Number, writeU8Fixed8Number, writeUTF
-
Constructor Details
-
MemoryCacheRandomAccessOutputStream
public MemoryCacheRandomAccessOutputStream(java.io.OutputStream dist)
-
-
Method Details
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classRandomAccessOutputStream- Throws:
java.io.IOException
-
disposeBefore
public void disposeBefore(long pos) throws java.io.IOException- Specified by:
disposeBeforein classRandomAccessOutputStream- Throws:
java.io.IOException
-
getFlushPos
public long getFlushPos()- Specified by:
getFlushPosin classRandomAccessOutputStream
-
getLength
public long getLength()Returns the total length of data that has been cached, regardless of whether any early blocks have been disposed. This value will only ever increase.- Specified by:
getLengthin classRandomAccessOutputStream
-
getStreamPointer
public long getStreamPointer()- Specified by:
getStreamPointerin classRandomAccessOutputStream- Returns:
- the current stream position
-
reset
public void reset()Description copied from class:RandomAccessOutputStreamReset this stream to be used again- Specified by:
resetin classRandomAccessOutputStream
-
seek
public void seek(long pos) throws java.io.IOException- Specified by:
seekin classRandomAccessOutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Specified by:
writein interfacejava.io.DataOutput- Specified by:
writein classRandomAccessOutputStream- Throws:
java.io.IOException
-
write
public void write(int value) throws java.io.IOException- Specified by:
writein interfacejava.io.DataOutput- Specified by:
writein classRandomAccessOutputStream- Throws:
java.io.IOException
-
writeToStream
public void writeToStream(long len) throws java.io.IOException- Specified by:
writeToStreamin classRandomAccessOutputStream- Throws:
java.io.IOException
-
shallowClose
public void shallowClose() throws java.io.IOExceptionDescription copied from class:RandomAccessOutputStreamCloses the RandomAccessInputStream and it's underlying stream- Specified by:
shallowClosein classRandomAccessOutputStream- Throws:
java.io.IOException
-