copyTo

fun copyTo(out: OutputStream, offset: Long = 0L, byteCount: Long = size - offset): Buffer
fun copyTo(out: Buffer, offset: Long = 0L, byteCount: Long): Buffer

Copy byteCount bytes from this, starting at offset, to out.

fun copyTo(out: Buffer, offset: Long = 0L, byteCount: Long): Buffer
fun copyTo(out: Buffer, offset: Long = 0L): Buffer
common
fun copyTo(out: Buffer, offset: Long = 0L): Buffer

Overload of copyTo with byteCount = size - offset, work around for https://youtrack.jetbrains.com/issue/KT-30847