Initial working version

This commit is contained in:
Samuel Kent
2022-12-22 20:22:22 +11:00
parent ce9675a1cc
commit ced7fa5092
902 changed files with 150252 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
/// <reference types="node" />
import { IRandomReader } from '../type';
/**
* Provides abstract file access via the IRandomRead interface
*/
export declare class RandomFileReader implements IRandomReader {
fileSize: number;
private readonly fd;
constructor(filePath: string, fileSize: number);
/**
* Read from a given position of an abstracted file or buffer.
* @param buffer {Buffer} is the buffer that the data will be written to.
* @param offset {number} is the offset in the buffer to start writing at.
* @param length {number}is an integer specifying the number of bytes to read.
* @param position {number} is an argument specifying where to begin reading from in the file.
* @return {Promise<number>} bytes read
*/
randomRead(buffer: Buffer, offset: number, length: number, position: number): Promise<number>;
close(): void;
}