Class TrackingSink

java.lang.Object
okio.ForwardingSink
com.amilesend.client.connection.file.TrackingSink
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, okio.Sink

public class TrackingSink extends okio.ForwardingSink
Tracking sink to monitor the amount of bytes transferred.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TrackingSink(@NonNull okio.Sink delegate, @NonNull TransferProgressCallback callback, long totalBytes)
    Creates a new TrackingSink instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    write(okio.Buffer source, long byteCount)
     

    Methods inherited from class okio.ForwardingSink

    close, delegate, -deprecated_delegate, flush, timeout, toString

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TrackingSink

      public TrackingSink(@NonNull @NonNull okio.Sink delegate, @NonNull @NonNull TransferProgressCallback callback, long totalBytes)
      Creates a new TrackingSink instance.
      Parameters:
      delegate - the sink to track
      callback - the callback to notify of progress
      totalBytes - the total number of bytes to transfer
  • Method Details

    • write

      public void write(okio.Buffer source, long byteCount) throws IOException
      Specified by:
      write in interface okio.Sink
      Overrides:
      write in class okio.ForwardingSink
      Throws:
      IOException