compound-binary-file-js
Version:
This is an implementation of [Compound Binary File v.3](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b) \ Allows reading existing files, creation of the/write operation
28 lines (27 loc) • 1.3 kB
TypeScript
import { FAT } from "../alloc/FAT";
import { MiniFAT } from "../alloc/MiniFAT";
import { Header } from "../Header";
import { Sectors } from "../Sectors";
import { CFDataview } from "../dataview/СFDataview";
import { Sector } from "../dataview/Sector";
import { StreamRW } from "./StreamRW";
export declare class MiniStreamRW implements StreamRW {
static readonly MINI_STREAM_CHUNK_SIZE = 64;
private readonly miniFAT;
private readonly header;
private miniStreamLength;
private readonly fat;
private readonly miniStreamSectorChain;
private readonly sectors;
constructor(miniFAT: MiniFAT, fat: FAT, firstMiniStreamSector: number, miniStreamLength: number, sectors: Sectors, header: Header);
read(startingSector: number, lengthOrFromIncl: number, toExcl?: number): number[];
getMiniSectorData(position: number): CFDataview;
write(data: number[]): number;
howManyChunksNeeded(dataLength: number): number;
writeAt(startingSector: number, position: number, data: number[]): void;
append(startingSector: number, currentSize: number, data: number[]): number;
getDataHolderForNextChunk(): CFDataview;
getSectorForNextChunk(): Sector;
getMiniStreamLength(): number;
getMiniStreamFirstSectorPosition(): number;
}