anchor.diff:              Expect.isTrue(bytesWritten == 0);
               Expect.isTrue(client.available() > 0);
               var buffer = client.read();
  -            data.setRange(bytesRead, buffer.length, buffer);
  -            bytesRead += buffer.length;
  +            if (buffer != null) {
  +              data.setRange(bytesRead, buffer.length, buffer);
  +              bytesRead += buffer.length;
  +              for (var value in buffer) {
  +                Expect.isTrue(value is int);
  +                Expect.isTrue(value < 256 && value >= 0);
  +              }
  +            }
               if (bytesRead == data.length) {
                 verifyTestData(data);
                 client.writeEventsEnabled = true;
  
positive.code:           case RawSocketEvent.READ:
              Expect.isTrue(socket.available() > 0);
              var buffer = socket.read();
              dataReceived.setRange(bytesRead, buffer.length, buffer);
              bytesRead += buffer.length;
              break;
            case RawSocketEvent.WRITE:
              Expect.isTrue(bytesRead == 0);
  
negative.code:             break;
            case RawSocketEvent.WRITE:
              Expect.isFalse(client.writeEventsEnabled);
              Expect.equals(bytesRead, data.length);
              for (int i = bytesWritten; i < data.length; ++i) {
                Expect.isTrue(data[i] is int);
                Expect.isTrue(data[i] < 256 && data[i] >= 0);
              }
              bytesWritten += client.write(
                  data, bytesWritten, data.length - bytesWritten);
              if (bytesWritten < data.length) {
  