Package io.milton.common
Class RandomFileOutputStream
java.lang.Object
java.io.OutputStream
io.milton.common.RandomFileOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
A positionable file output stream.
Threading Design : [x] Single Threaded [ ] Threadsafe [ ] Immutable [ ] Isolated From http://stackoverflow.com/questions/825732/how-can-i-implement-an-outputstream-that-i-can-rewind
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRandomFileOutputStream(File fil, boolean syn) RandomFileOutputStream(String fnm, boolean syn) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()getFD()longlongvoidsetFilePointer(long pos) voidsetFileSize(long len) voidwrite(byte[] val) voidwrite(byte[] val, int off, int len) voidwrite(int val) Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
randomFile
-
sync
protected boolean sync
-
-
Constructor Details
-
RandomFileOutputStream
- Throws:
IOException
-
RandomFileOutputStream
- Throws:
IOException
-
RandomFileOutputStream
- Throws:
IOException
-
RandomFileOutputStream
- Throws:
IOException
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
getFilePointer
- Throws:
IOException
-
setFilePointer
- Throws:
IOException
-
getFileSize
- Throws:
IOException
-
setFileSize
- Throws:
IOException
-
getFD
- Throws:
IOException
-