     public function BinaryData(bytes:ArrayBuffer = null)
     {
         ba = bytes ? bytes : new ArrayBuffer(0);
+        _len = ba.byteLength;
     }
 
     /**

    private function mergeInToArrayBuffer(offset:uint, newBytes:Uint8Array):uint {
        var newContentLength:uint = newBytes.length;
        var dest:Uint8Array;
        if (offset + newContentLength > ba.byteLength) {
            dest = new Uint8Array(offset + newContentLength);
            dest.set(new Uint8Array(ba, 0, offset));
            dest.set(newBytes, offset);

        {
            //do we need to check offset and length and sanitize or throw an error?

            if (length == 0) length = _len - _position ;
            //extend the destination length if necessary
            var extra:int = offset + length - destination._len;
            if (extra > 0)
                destination.growBuffer(extra);
            var src:Uint8Array = new Uint8Array(ba, _position,length);
