readAsync
abstract fun <T : ArrayBufferView<*>> readAsync(buffer: T, offset: Double? = definedExternally, length: Double? = definedExternally, position: Double? = definedExternally): Promise<FileReadResult<T>>(source)
Reads data from the file and stores that in the given buffer.
If the file is not modified concurrently, the end-of-file is reached when the number of bytes read is zero.
Since
v10.0.0
Return
Fulfills upon success with an object with two properties:
Parameters
buffer
A buffer that will be filled with the file data read.
offset
The location in the buffer at which to start filling.
length
The number of bytes to read.
position
The location where to begin reading data from the file. If null
, data will be read from the current file position, and the position will be updated. If position
is an integer, the current file position will remain unchanged.
abstract fun <T : ArrayBufferView<*>> readAsync(options: FileReadOptions<T> = definedExternally): Promise<FileReadResult<T>>(source)