[Update: my answer assumes HTML / Javascript AIR, unlike Flash / Actionscript. There may be better answers on the AS3 side ...]
FileStream CSV. , CSV SQLite, , , ( ).
, FileStream, , . : STDOUT , FileStream .
this.process.addEventListener(air.ProgressEvent.STANDARD_OUTPUT_DATA, function(event) {
});
Foo.prototype._stdoutHandler = function() {
var nBytes = this.process.standardOutput.bytesAvailable;
var msg = this.process.standardOutput.readUTFBytes(nBytes);
this._sofar += msg;
while (true) {
var idx = this._sofar.indexOf("\n");
if (idx < 0)
break;
if (idx > 0) {
var line = this._sofar.substring(0, idx);
this._foundLine(line);
}
if (this._sofar.length > idx + 1) {
this._sofar = this._sofar.substring(idx+1);
} else {
this._sofar = "";
}
}
var lines = this._sofar.split(/\n/);
if (lines.length > 1) {
air.trace("programming error: we should have already handled all newlines");
}
this._sofar = lines[lines.length - 1];
};
Foo.prototype._foundLine = function() {
};