title: Why might '_Uint8ArrayView' be returned to a Dart command line client's websocket onData handler?
body: <p>I have a command line Dart script client interacting over a [dart:io] websocket with a Jetty server. I've implemented a custom message subprotocol that uses reflection (both sides) to exchange Dart objects with Java objects in Jetty using binary encoding. PODO -> Uint8List -> wire -> ByteBufer -> POJO (and in reverse for the return trip). The local round trip unit tests execute correctly on either side (i.e. PODO -> Uint8List -> PODO; POJO -> ByteBuffer -> POJO). I've tested the connection with a different service endpoint using a series of simple 'string' exchanges. The transmission from Dart to Jetty works but the response data, although correctly received, produces an odd type that I don't understand and which the decoder doesn't understand as either a Uint8List, ByteBuffer, etc. </p>
  
  <p>Although I can't easily distill this into a small example, here is the relevant code and some output:</p>
  
  <p><strong>Dart Client:</strong></p>
  
  
  
  <pre class="lang-dart prettyprint-override"><code>WebSocket.connect(url).then((WebSocket socket) {
    _log.finer('connected');
    _websocket = socket
      ..listen(_onResponse, onError: (e, StackTrace st) =&gt; print('Session error: $e; $st'));
    ...
  }
  
  _onResponse(data) {
    print('response raw data: $data');
    InstanceMirror im = reflect(data);
    print('instance: $im');
    ...
    decode(data)
  }
  
  decode(Uint8List data) {
    var b = data.buffer;
    ByteData bd = new ByteData.view(b);
    int offset = 0;
    const ENDIANNESS = Endianness.LITTLE_ENDIAN;
  
    int msgLength = bd.getInt32(offset, ENDIANNESS); // is 6645122; should be 101
    ...
  }
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre class="lang-dart prettyprint-override"><code>    response raw data: [101, 0, 0, 0, ...]
      instance: InstanceMirror on Instance of '_Uint8ArrayView'
  </code></pre>
  
  <p><strong>The IntelliJ debugger shows:</strong></p>
  
  <pre class="lang-dart prettyprint-override"><code>    data = {List[id=1]} size = 101
      &gt; im = {_LocalInstanceMirror[id=2]} InstanceMirror on Instance of '_Uint8ArrayView'
          _reflectee = {List[id=1]}
          _type = null
          hasReflectee = true
  </code></pre>