diff --git a/dist/main.js b/dist/main.js index 8e7253c..97a3bb1 100644 --- a/dist/main.js +++ b/dist/main.js @@ -32,7 +32,7 @@ export class DumbPort extends Duplex { _write(obj, encodingOrCallback, callback) { const actualCallback = callback || typeof encodingOrCallback === "function" ? encodingOrCallback : undefined; if (Buffer.isBuffer(obj)) { - this.buf.writeUInt32BE(obj.byteLength); + this.buf.writeUInt16BE(obj.byteLength); obj.copy(this.buf, DumbPort.LEN_LEN); process.stdout.write(this.buf.subarray(0, obj.byteLength + DumbPort.LEN_LEN), actualCallback); } diff --git a/src/main.ts b/src/main.ts index 2c7013f..3e03f04 100644 --- a/src/main.ts +++ b/src/main.ts @@ -42,7 +42,7 @@ export class DumbPort extends Duplex { const actualCallback: any = callback || typeof encodingOrCallback === "function" ? encodingOrCallback : undefined; if (Buffer.isBuffer(obj)) { - this.buf.writeUInt32BE(obj.byteLength); + this.buf.writeUInt16BE(obj.byteLength); obj.copy(this.buf, DumbPort.LEN_LEN); process.stdout.write( this.buf.subarray(0, obj.byteLength + DumbPort.LEN_LEN),