Package okio

Class ForwardingSink

java.lang.Object
okio.ForwardingSink
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, Sink
Direct Known Subclasses:
HashingSink

public abstract class ForwardingSink extends Object implements Sink
A Sink which forwards calls to another. Useful for subclassing.
  • Constructor Details

    • ForwardingSink

      public ForwardingSink(Sink delegate)
  • Method Details

    • delegate

      public final Sink delegate()
      Sink to which this instance is delegating.
    • write

      public void write(Buffer source, long byteCount) throws IOException
      Description copied from interface: Sink
      Removes byteCount bytes from source and appends them to this.
      Specified by:
      write in interface Sink
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Description copied from interface: Sink
      Pushes all buffered bytes to their final destination.
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in interface Sink
      Throws:
      IOException
    • timeout

      public Timeout timeout()
      Description copied from interface: Sink
      Returns the timeout for this sink.
      Specified by:
      timeout in interface Sink
    • close

      public void close() throws IOException
      Description copied from interface: Sink
      Pushes all buffered bytes to their final destination and releases the resources held by this sink. It is an error to write a closed sink. It is safe to close a sink more than once.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Sink
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object