skip

abstract fun skip(byteCount: Long)(source)

Reads and discards byteCount bytes from this source.

Parameters

byteCount

the number of bytes to be skipped.

Throws

when the source is exhausted before the requested number of bytes can be skipped.

when the source is closed.

when some I/O error occurs.

Samples

import kotlinx.io.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   val buffer = Buffer()
buffer.write(byteArrayOf(1, 2, 3, 4, 5, 6, 7, 8))

buffer.skip(3)
assertContentEquals(byteArrayOf(4, 5, 6, 7, 8), buffer.readByteArray()) 
   //sampleEnd
}