writeWhileSize
inline fun Output.writeWhileSize(initialSize: Int = 1, block: (Buffer) -> Int)
Content copied to clipboard
Append number of chunks invoking block function while the returned value is positive. If returned value is positive then it will be invoked again with a buffer having at least requested number of bytes space (could be the same buffer as before if it complies to the restriction).
Parameters
initialSize
for the first buffer passed to block function