@ecash/lib
Version:
Library for eCash transaction building
28 lines • 1.1 kB
TypeScript
import { Endian } from './bytes.js';
import { Int } from './int.js';
import { Writer } from './writer.js';
/**
* Implementation of `Writer` which writes to an array of pre-allocated size.
* It's intended to be used in unison with `WriterLength`, which first finds
* out the length of the serialized object and then the actual data is written
* using this class.
**/
export declare class WriterBytes implements Writer {
data: Uint8Array;
view: DataView;
idx: number;
/** Create a new WriterBytes with the given pre-allocated size */
constructor(length: number);
/** Write a single byte */
putU8(value: Int): void;
/** Write a 2-byte little-endian integer (uint16_t) */
putU16(value: Int, endian?: Endian): void;
/** Write a 4-byte little-endian integer (uint32_t) */
putU32(value: Int, endian?: Endian): void;
/** Write an 8-byte little-endian integer (uint64_t) */
putU64(value: Int, endian?: Endian): void;
/** Write the given bytes */
putBytes(bytes: Uint8Array): void;
private ensureSize;
}
//# sourceMappingURL=writerbytes.d.ts.map