@gmod/cram
Version:
read CRAM files with pure Javascript
28 lines (27 loc) • 626 B
TypeScript
interface Stream {
readByte(): number;
seek(pos: number): void;
}
export default class BitReader {
private stream;
private bitOffset;
private curByte;
private hasByte;
constructor(stream: Stream);
private _ensureByte;
/**
* Reads bits from the buffer
* @param bits Number of bits to read
*/
read(bits: number): number;
/**
* Seek to an arbitrary point in the buffer (expressed in bits)
* @param pos Position in bits
*/
seek(pos: number): void;
/**
* Reads 6 bytes worth of data using the read method
*/
pi(): string;
}
export {};