concat header and data

This commit is contained in:
Elijah 2023-12-10 14:13:29 -05:00
parent 3a0a2167df
commit 5cd5ba57c2

View file

@ -62,8 +62,7 @@ export default class VM {
var header = Buffer.alloc(4);
header.writeUInt32LE(data.length);
await this.#writeLock.runExclusive(async () => {
await this.#writeData(header);
await this.#writeData(data);
await this.#writeData(Buffer.concat([header, data]));
res();
});
});