Interface IOUtilities.TransferCallback

Enclosing class:
IOUtilities
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface IOUtilities.TransferCallback
Callback interface for monitoring and controlling byte transfers.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bytesTransferred(byte[] bytes, int count)
    Called when bytes are transferred during an operation.
    default boolean
    Checks if the transfer operation should be cancelled.
  • Method Details

    • bytesTransferred

      void bytesTransferred(byte[] bytes, int count)
      Called when bytes are transferred during an operation.
      Parameters:
      bytes - the buffer containing the transferred bytes
      count - the number of bytes actually transferred
    • isCancelled

      default boolean isCancelled()
      Checks if the transfer operation should be cancelled. Default implementation returns false.
      Returns:
      true if the transfer should be cancelled, false to continue