readAsync

suspend fun FileStream.Read.readAsync(buf: ByteArray, offset: Int, len: Int): Int(source)
inline suspend fun FileStream.Read.readAsync(buf: ByteArray): Int(source)

An asynchronous version of FileStream.Read.read. If FileStream was not opened using AsyncFs, thus not inheriting its CoroutineContext, then the default AsyncFs.ctx will be used instead.

NOTE: On Js/WasmJs, this function acquires a position lock. Synchronous FileStream function calls also requiring the position lock will result in failure until this asynchronous function returns. This is a platform limitation and can be avoided by not intermixing synchronous, and asynchronous functionality.

See also


suspend fun FileStream.Read.readAsync(buf: ByteArray, offset: Int, len: Int, position: Long): Int(source)
inline suspend fun FileStream.Read.readAsync(buf: ByteArray, position: Long): Int(source)

An asynchronous version of FileStream.Read.read. If FileStream was not opened using AsyncFs, thus not inheriting its CoroutineContext, then the default AsyncFs.ctx will be used instead.

See also

suspend fun FileStream.Read.readAsync(buf: Buffer, offset: Long, len: Long): Long(source)
inline suspend fun FileStream.Read.readAsync(buf: Buffer): Long(source)

An asynchronous version of FileStream.Read.read. If FileStream was not opened using AsyncFs, thus not inheriting its CoroutineContext, then the default AsyncFs.ctx will be used instead.

NOTE: This function acquires a position lock. Synchronous FileStream function calls also requiring the position lock will result in failure until this asynchronous function returns. This is a platform limitation and can be avoided by not intermixing synchronous, and asynchronous functionality.

See also


suspend fun FileStream.Read.readAsync(buf: Buffer, offset: Long, len: Long, position: Long): Long(source)
inline suspend fun FileStream.Read.readAsync(buf: Buffer, position: Long): Long(source)

An asynchronous version of FileStream.Read.read. If FileStream was not opened using AsyncFs, thus not inheriting its CoroutineContext, then the default AsyncFs.ctx will be used instead.

See also

suspend fun FileStream.Read.readAsync(dst: ByteBuffer?): Int(source)
suspend fun FileStream.Read.readAsync(dst: ByteBuffer?, position: Long): Int(source)

An asynchronous version of FileStream.Read.read. If FileStream was not opened using AsyncFs, thus not inheriting its CoroutineContext, then the default AsyncFs.ctx will be used instead.

See also