Interface StreamingDataOutputPlus

All Superinterfaces:
AutoCloseable, Closeable, DataOutput, DataOutputPlus
All Known Implementing Classes:
AsyncStreamingOutputPlus, StreamingDataOutputPlusFixed

public interface StreamingDataOutputPlus extends DataOutputPlus, Closeable
  • Method Details

    • writeToChannel

      Provide a lambda that can request a buffer of suitable size, then fill the buffer and have that buffer written and flushed to the underlying channel, without having to handle buffer allocation, lifetime or cleanup, including in case of exceptions.

      Any exception thrown by the Write will be propagated to the caller, after any buffer is cleaned up.

      Throws:
      IOException
    • writeFileToChannel

      long writeFileToChannel(FileChannel file, StreamingDataOutputPlus.RateLimiter limiter) throws IOException
      Writes all data in file channel to stream:
      * For zero-copy-streaming, 1MiB at a time, with at most 2MiB in flight at once.
      * For streaming with SSL, 64KiB at a time, with at most 32+64KiB (default low water mark + batch size) in flight.

      This method takes ownership of the provided FileChannel.

      WARNING: this method blocks only for permission to write to the netty channel; it exits before the FileRegion(zero-copy) or ByteBuffer(ssl) is flushed to the network.

      Throws:
      IOException
    • flush

      default void flush() throws IOException
      Throws:
      IOException