Package pixy.io
Class FileCacheRandomAccessOutputStream
java.lang.Object
java.io.OutputStream
pixy.io.RandomAccessOutputStream
pixy.io.FileCacheRandomAccessOutputStream
- All Implemented Interfaces:
java.io.Closeable,java.io.DataOutput,java.io.Flushable,java.lang.AutoCloseable
public class FileCacheRandomAccessOutputStream extends RandomAccessOutputStream
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FileCacheRandomAccessOutputStream(java.io.OutputStream dist)FileCacheRandomAccessOutputStream(java.io.OutputStream dist, int bufLen) -
Method Summary
Modifier and Type Method Description voidclose()Closes this stream and releases any system resources associated with the stream.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
-
FileCacheRandomAccessOutputStream
public FileCacheRandomAccessOutputStream(java.io.OutputStream dist) throws java.io.IOException- Throws:
java.io.IOException
-
FileCacheRandomAccessOutputStream
public FileCacheRandomAccessOutputStream(java.io.OutputStream dist, int bufLen) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Details
-
close
public void close() throws java.io.IOExceptionCloses this stream and releases any system resources associated with the stream.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classRandomAccessOutputStream- Throws:
java.io.IOException- if an I/O error occurs.
-
disposeBefore
public void disposeBefore(long pos)- Specified by:
disposeBeforein classRandomAccessOutputStream
-
getFlushPos
public long getFlushPos()- Specified by:
getFlushPosin classRandomAccessOutputStream
-
getLength
public long getLength()Description copied from class:RandomAccessOutputStreamReturns 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
-