|
@ -82,8 +82,8 @@ StringDecoder.prototype.write = function(buffer) { |
|
|
while (this.charLength) { |
|
|
while (this.charLength) { |
|
|
// determine how many remaining bytes this buffer has to offer for this char
|
|
|
// determine how many remaining bytes this buffer has to offer for this char
|
|
|
var available = (buffer.length >= this.charLength - this.charReceived) ? |
|
|
var available = (buffer.length >= this.charLength - this.charReceived) ? |
|
|
this.charLength - this.charReceived : |
|
|
this.charLength - this.charReceived : |
|
|
buffer.length; |
|
|
buffer.length; |
|
|
|
|
|
|
|
|
// add the new bytes to the char buffer
|
|
|
// add the new bytes to the char buffer
|
|
|
buffer.copy(this.charBuffer, this.charReceived, 0, available); |
|
|
buffer.copy(this.charBuffer, this.charReceived, 0, available); |
|
|