blob: c15f74bf03dd2b513bd82d5e3cf64d21627d9f9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/// <reference types="node" />
import { AbstractTokenizer } from './AbstractTokenizer';
import { IFileInfo, IReadChunkOptions } from './types';
export declare class FileTokenizer extends AbstractTokenizer {
private fd;
constructor(fd: number, fileInfo: IFileInfo);
/**
* Read buffer from file
* @param buffer
* @param options - Read behaviour options
* @returns Promise number of bytes read
*/
readBuffer(buffer: Buffer, options?: IReadChunkOptions): Promise<number>;
/**
* Peek buffer from file
* @param buffer
* @param options - Read behaviour options
* @returns Promise number of bytes read
*/
peekBuffer(buffer: Buffer, options?: IReadChunkOptions): Promise<number>;
/**
* @param length - Number of bytes to ignore
* @return resolves the number of bytes ignored, equals length if this available, otherwise the number of bytes available
*/
ignore(length: number): Promise<number>;
close(): Promise<void>;
}
export declare function fromFile(sourceFilePath: string): Promise<FileTokenizer>;
|