Internal

object Internal
class Object
trait Matchable
class Any

Value members

Concrete methods

def encodedLength(sequence: String): Int
def transfer(src: InputStream, dest: OutputStream, minBufferSize: Int, maxBufferSize: Int, bufferGrowthRatio: Int): Unit
def transfer0(src: InputStream, sink: (Array[Byte], Int) => Unit, minBufferSize: Int, maxBufferSize: Int, bufferGrowthRatio: Int): Unit

Transfers data from the given InputStream through a to a sink function through a dynamically sized transfer buffer.

Transfers data from the given InputStream through a to a sink function through a dynamically sized transfer buffer.

The buffer is sized based on the .available number on the input stream, clamped a minBufferSize and maxBufferSize size, and allowed to grow in increments of 2x if the total amount of bytes transferred exceeds the size of the buffer by bufferGrowthRatio.

This should allow efficient processing of InputStreams of all sizes, from the tiny to the very large, without over- or under- allocating the size of the transfer buffer.