Class FilesystemOutputStream

java.lang.Object
java.io.OutputStream
com.basis.filesystem.FilesystemOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class FilesystemOutputStream extends OutputStream
OutputStream for STRING and PROGRAM files.
See Also:
  • Constructor Details

  • Method Details

    • write

      public void write(byte[] b) throws IOException
      Writes b.length bytes from b to the FilePosition.
      Overrides:
      write in class OutputStream
      Parameters:
      b - the byte array from which to write.
      Throws:
      IOException - If writing to the FilePosition causes an exception to be thrown.
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Writes len bytes from b starting at offset off.
      Overrides:
      write in class OutputStream
      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

      public void write(int b) throws IOException
      Writes one byte to the file at a time.
      Specified by:
      write in class OutputStream
      Parameters:
      b - the byte to write.
      Throws:
      IOException - If writing to the FilePosition causes an exception to be thrown.
    • close

      public void close() throws IOException
      close() closes the FilePosition associated with this FilesystemOutputStream.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream
      Throws:
      IOException - if an error occurs while closing the FilePosition.
    • flush

      public void flush() throws IOException
      flush() flushes the buffers to the Filesystem.
      Specified by:
      flush in interface Flushable
      Overrides:
      flush in class OutputStream
      Throws:
      IOException