concat header and data
This commit is contained in:
parent
3a0a2167df
commit
5cd5ba57c2
1 changed files with 1 additions and 2 deletions
|
@ -62,8 +62,7 @@ export default class VM {
|
||||||
var header = Buffer.alloc(4);
|
var header = Buffer.alloc(4);
|
||||||
header.writeUInt32LE(data.length);
|
header.writeUInt32LE(data.length);
|
||||||
await this.#writeLock.runExclusive(async () => {
|
await this.#writeLock.runExclusive(async () => {
|
||||||
await this.#writeData(header);
|
await this.#writeData(Buffer.concat([header, data]));
|
||||||
await this.#writeData(data);
|
|
||||||
res();
|
res();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue