template-saas/apps/backend/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js
rckrdmrd 50a821a415
Some checks failed
CI / Backend CI (push) Has been cancelled
CI / Frontend CI (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / CI Summary (push) Has been cancelled
[SIMCO-V38] feat: Actualizar a SIMCO v3.8.0
- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8
- Actualizaciones de configuracion

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 08:53:08 -06:00

37 lines
1.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ByteArrayCollector = void 0;
class ByteArrayCollector {
allocByteArray;
byteLength = 0;
byteArrays = [];
constructor(allocByteArray) {
this.allocByteArray = allocByteArray;
}
push(byteArray) {
this.byteArrays.push(byteArray);
this.byteLength += byteArray.byteLength;
}
flush() {
if (this.byteArrays.length === 1) {
const bytes = this.byteArrays[0];
this.reset();
return bytes;
}
const aggregation = this.allocByteArray(this.byteLength);
let cursor = 0;
for (let i = 0; i < this.byteArrays.length; ++i) {
const bytes = this.byteArrays[i];
aggregation.set(bytes, cursor);
cursor += bytes.byteLength;
}
this.reset();
return aggregation;
}
reset() {
this.byteArrays = [];
this.byteLength = 0;
}
}
exports.ByteArrayCollector = ByteArrayCollector;