Package net.apartium.cocoabeans.seekable
Class SeekableOutputStream
java.lang.Object
java.io.OutputStream
net.apartium.cocoabeans.seekable.SeekableOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()SeekableByteChannel doesn't have a buffer so nothing we need to dostatic SeekableOutputStreamOpen a file as SeekableOutputStream and if the file doesn't exist we create onelongposition()Current positionvoidposition(long newPos) Jump to new positionlongsize()size of the entire channelvoidwrite(byte[] b, int off, int len) voidwrite(int b) Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
Constructor Details
-
SeekableOutputStream
-
-
Method Details
-
open
Open a file as SeekableOutputStream and if the file doesn't exist we create one- Parameters:
path- path to the file- Returns:
- new instance of SeekableOutputStream to the file
- Throws:
IOException
-
position
Current position- Returns:
- current position
- Throws:
IOException
-
position
Jump to new position- Parameters:
newPos- memory address- Throws:
IOException
-
size
size of the entire channel- Returns:
- file size
- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush()SeekableByteChannel doesn't have a buffer so nothing we need to do- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-