Package com.cedarsoftware.util
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.
Callback interface for monitoring and controlling byte transfers.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 bytescount
- 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
-