Class OperatorOutputStream

java.lang.Object
java.io.OutputStream
org.apache.opendal.OperatorOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class OperatorOutputStream extends OutputStream
  • Constructor Details

  • Method Details

    • write

      public void write(int b) throws IOException
      Specified by:
      write in class OutputStream
      Throws:
      IOException
    • write

      public void write(byte[] b, int off, int len) throws IOException
      Overrides:
      write in class OutputStream
      Throws:
      IOException
    • flush

      public void flush()
      Specified by:
      flush in interface Flushable
      Overrides:
      flush in class OutputStream
    • abort

      public void abort()
      Discards buffered bytes and asks the backend to clean up the unfinished write.

      Call this before close() to abandon an upload, for example when reading the source fails. Cleanup depends on the backend. Data already visible may remain, and a previous object may not be restored.

      This releases the native writer even if cleanup fails. Subsequent writes and flushes throw IllegalStateException. Subsequent calls to abort() or close() do nothing.

      Throws:
      OpenDALException - if backend cleanup fails or is unsupported
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class OutputStream