| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/local/lib/node_modules/pm2/node_modules/basic-ftp/dist/ |
Upload File : |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StringWriter = void 0;
const stream_1 = require("stream");
class StringWriter extends stream_1.Writable {
constructor(maxByteLength = 1 * 1024 * 1024) {
super();
this.maxByteLength = maxByteLength;
this.byteLength = 0;
this.bufs = [];
}
_write(chunk, _, callback) {
if (!(chunk instanceof Buffer)) {
callback(new Error("StringWriter: expects chunks of type 'Buffer'."));
return;
}
if (this.byteLength + chunk.byteLength > this.maxByteLength) {
callback(new Error(`StringWriter: Maximum bytes exceeded, maxByteLength=${this.maxByteLength}.`));
return;
}
this.byteLength += chunk.byteLength;
this.bufs.push(chunk);
callback(null);
}
getText(encoding) {
return Buffer.concat(this.bufs).toString(encoding);
}
}
exports.StringWriter = StringWriter;