Package com.basis.filesystem
Class FilesystemOutputStream
java.lang.Object
java.io.OutputStream
com.basis.filesystem.FilesystemOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
OutputStream
for STRING and PROGRAM files.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFilesystemOutputStream
(FilePosition p_fpos) Constructor from aFilePosition
.FilesystemOutputStream
(FilePosition p_fpos, boolean p_buffered) Constructor from aFilePosition
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
close() closes the FilePosition associated with this FilesystemOutputStream.void
flush()
flush() flushes the buffers to the Filesystem.void
write
(byte[] b) Writesb.length
bytes fromb
to the FilePosition.void
write
(byte[] b, int off, int len) Writeslen
bytes fromb
starting at offsetoff
.void
write
(int b) Writes one byte to the file at a time.Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
FilesystemOutputStream
Constructor from aFilePosition
.- Parameters:
p_fpos
-FilePosition
to write to.- Throws:
FilesystemException
-
FilesystemOutputStream
Constructor from aFilePosition
.- Parameters:
p_fpos
-FilePosition
to write to.p_buffered
- If writes should be buffered.- Throws:
FilesystemException
-
-
Method Details
-
write
Writesb.length
bytes fromb
to the FilePosition.- Overrides:
write
in classOutputStream
- Parameters:
b
- the byte array from which to write.- Throws:
IOException
- If writing to the FilePosition causes an exception to be thrown.
-
write
Writeslen
bytes fromb
starting at offsetoff
.- Overrides:
write
in classOutputStream
- Parameters:
b
- the byte to write.off
- the offset in the byte array from which to write.len
- the number of bytes to write from the byte array.- Throws:
IOException
- If writing to the FilePosition causes an exception to be thrown.
-
write
Writes one byte to the file at a time.- Specified by:
write
in classOutputStream
- Parameters:
b
- the byte to write.- Throws:
IOException
- If writing to the FilePosition causes an exception to be thrown.
-
close
close() closes the FilePosition associated with this FilesystemOutputStream.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
- if an error occurs while closing the FilePosition.
-
flush
flush() flushes the buffers to the Filesystem.- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-