1 //<script type="text/javscript">
3 XObject = imports.XObject.XObject;
9 TextStream = function(text) {
10 if (typeof(text) == "undefined") text = "";
16 XObject.extend( TextStream.prototype, {
19 if (typeof n == "undefined") n = 0;
21 if (this.cursor+n < 0 || this.cursor+n >= this.text.length) {
22 var result = new String("");
26 return this.text.charAt(this.cursor+n);
30 if (typeof n == "undefined") n = 1;
31 if (n < 1) return null;
34 for (var i = 0; i < n; i++) {
35 if (this.cursor+i < this.text.length) {
36 pulled += this.text.charAt(this.cursor+i);
39 var result = new String("");