(text)
| 50 | } |
| 51 | |
| 52 | addText(text) { |
| 53 | this._buffer = undefined; |
| 54 | |
| 55 | let inPos = this._inPos + this._buf.write(text, this._inPos, this._encoding); |
| 56 | |
| 57 | // if we've hit (or nearing capacity), grow the buf |
| 58 | while (inPos >= this._buf.length - 4) { |
| 59 | this._grow(this._inPos + text.length); |
| 60 | |
| 61 | // keep trying to write until we've completely written the text |
| 62 | inPos = this._inPos + this._buf.write(text, this._inPos, this._encoding); |
| 63 | } |
| 64 | |
| 65 | this._inPos = inPos; |
| 66 | } |
| 67 | |
| 68 | addStringBuf(inBuf) { |
| 69 | if (inBuf.length) { |