method FileHandle.read
Overload 1
#FileHandle.read<T extends ArrayBufferView>(buffer: T,offset?: number | null,length?: number | null,position?: number | null,): Promise<FileReadResult<T>>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.
Type Parameters #
#T extends ArrayBufferView Parameters #
#offset: number | null optional
The location in the buffer at which to start filling.
#length: number | null optional
The number of bytes to read.
#position: number | null optional
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.
Return Type #
Promise<FileReadResult<T>> Fulfills upon success with an object with two properties:
Overload 2
#FileHandle.read<T extends ArrayBufferView = Buffer>(buffer: T,options?: FileReadOptions<T>,): Promise<FileReadResult<T>>Overload 3
#FileHandle.read<T extends ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>Type Parameters #
#T extends ArrayBufferView = Buffer Parameters #
#options: FileReadOptions<T> optional
Return Type #
Promise<FileReadResult<T>>