forked from p3t2ja9zs/dcs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
609 B
22 lines
609 B
module.exports = LocalInfileRequestPacket;
|
|
function LocalInfileRequestPacket(options) {
|
|
options = options || {};
|
|
|
|
this.filename = options.filename;
|
|
}
|
|
|
|
LocalInfileRequestPacket.prototype.parse = function parse(parser) {
|
|
if (parser.parseLengthCodedNumber() !== null) {
|
|
var err = new TypeError('Received invalid field length');
|
|
err.code = 'PARSER_INVALID_FIELD_LENGTH';
|
|
throw err;
|
|
}
|
|
|
|
this.filename = parser.parsePacketTerminatedString();
|
|
};
|
|
|
|
LocalInfileRequestPacket.prototype.write = function write(writer) {
|
|
writer.writeLengthCodedNumber(null);
|
|
writer.writeString(this.filename);
|
|
};
|