Add buffer packer

This commit is contained in:
Dolan Miu
2018-07-01 02:16:11 +01:00
parent 4b06baab3f
commit ded155a6af
4 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import { File } from "../../file";
import { BufferStream } from "./buffer-stream";
import { Compiler } from "./compiler";
export class BufferPacker {
private readonly packer: Compiler;
constructor(file: File) {
this.packer = new Compiler(file);
}
public async pack(): Promise<Buffer> {
const stream = new BufferStream();
await this.packer.compile(stream);
return stream.Buffer;
}
}