         }
         COMPILE::JS
         {
-            return ba.byteLength;
+            return _len;;
         }
     }
 

    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);

        }
    }

    COMPILE::JS
    private var _len:uint;


    public function get length():int
    {
