public interface StreamingDataOutputPlus extends DataOutputPlus, java.io.Closeable
Modifier and Type | Interface and Description |
---|---|
static interface |
StreamingDataOutputPlus.BufferSupplier |
static interface |
StreamingDataOutputPlus.RateLimiter |
static interface |
StreamingDataOutputPlus.Write |
Modifier and Type | Method and Description |
---|---|
default void |
flush() |
long |
writeFileToChannel(java.nio.channels.FileChannel file,
StreamingDataOutputPlus.RateLimiter limiter)
Writes all data in file channel to stream:
* For zero-copy-streaming, 1MiB at a time, with at most 2MiB in flight at once. |
int |
writeToChannel(StreamingDataOutputPlus.Write write,
StreamingDataOutputPlus.RateLimiter limiter)
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.
|
hasPosition, position, write, write, writeBytes, writeUnsignedVInt, writeVInt
int writeToChannel(StreamingDataOutputPlus.Write write, StreamingDataOutputPlus.RateLimiter limiter) throws java.io.IOException
Any exception thrown by the Write will be propagated to the caller, after any buffer is cleaned up.
java.io.IOException
long writeFileToChannel(java.nio.channels.FileChannel file, StreamingDataOutputPlus.RateLimiter limiter) throws java.io.IOException
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.
java.io.IOException
default void flush() throws java.io.IOException
java.io.IOException
Copyright © 2009-2022 The Apache Software Foundation