context: function dfile_dataavailable(e){    e.type = "rawdata";    e.destMethod = "onRawData";        try    {        if (this.state.dir == DCC_DIR_SENDING)        {            while (e.data.length >= 4)            {                var word = e.data.substr(0, 4);                e.data = e.data.substr(4, e.data.length - 4);                var pos = word.charCodeAt(0) * 0x01000000                        + word.charCodeAt(1) * 0x00010000                        + word.charCodeAt(2) * 0x00000100                        + word.charCodeAt(3) * 0x00000001;                this.ackPosition = pos;            }                        while (this.position <= this.ackPosition + this.parent.maxUnAcked)            {                var d;                if (this.position + this.parent.sendChunk > this.size)                    d = this.filestream.readBytes(this.size - this.position);                else                    d = this.filestream.readBytes(this.parent.sendChunk);                                this.position += d.length;                this.connection.sendData(d);                                if (this.position >= this.size)                    break;            }        }        else if (this.state.dir == DCC_DIR_GETTING)        {            this.filestream.writeBytes(e.data, e.data.length);                        // Send back ack data.            this.position += e.data.length;            var bytes = new Array();            for (var i = 0; i < 4; i++)                bytes.push(Math.floor(this.position / Math.pow(256, i)) & 255);                        this.connection.sendData(String.fromCharCode(bytes[3], bytes[2], bytes[1], bytes[0]));                        if (this.size && (this.position >= this.size))                this.disconnect();        }    }    catch(ex)    {        this.disconnect();    }        return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d84f82bf3e11bd09e70e1036662b0018f8834acc/dcc.js/clean/extensions/irc/js/lib/dcc.js