Class CallbackReadableByteChannel

java.lang.Object
org.tentackle.update.CallbackReadableByteChannel
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, ReadableByteChannel

public class CallbackReadableByteChannel extends Object implements ReadableByteChannel
A ReadableByteChannel with an optional callback lambda to show the progress.
  • Constructor Details

    • CallbackReadableByteChannel

      public CallbackReadableByteChannel(ReadableByteChannel channel, long expectedSize, Consumer<Double> progressConsumer)
      Creates a callback read channel.
      Parameters:
      channel - the channel to be wrapped
      expectedSize - the expected size, negative if indefinite
      progressConsumer - the optional consumer receiving the progress from 0.0 to 1.0 (negative if indefinite), null if none
  • Method Details