Closed erakis closed 8 years ago
Hi,
When calling the function readBuffer() without specifying the len, the internal endpoint variable is set to NaN.
But in the doc : @param len {Number} Numbers of bytes to read. (Defaults to the remaining data length)
@param len {Number} Numbers of bytes to read. (Defaults to the remaining data length)
Defaults is not set properly. Fix proposed :
SmartBuffer.prototype.readBuffer = function (len) { var endpoint = Math.min(this.length, this._readOffset + (len || this.length)); var ret = this.buff.slice(this._readOffset, endpoint); this._readOffset = endpoint; return ret; };
Sorry, I don't have time to create a pull requests at this time.
Should be fixed. Thanks for spotting that!
Hi,
When calling the function readBuffer() without specifying the len, the internal endpoint variable is set to NaN.
But in the doc :
@param len {Number} Numbers of bytes to read. (Defaults to the remaining data length)
Defaults is not set properly. Fix proposed :
Sorry, I don't have time to create a pull requests at this time.