| Server IP : 159.203.156.69 / Your IP : 216.73.216.179 Web Server : nginx/1.24.0 System : Linux main-ubuntu 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /proc/self/root/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;