anchor.diff:    writeString(value) {
       // optimistically, 1 byte per char
       int firstPos=bufPos;
  +    _ensureSpace(8+value.length*2);
       writeTypeAndLength(_STRING1, value.length);
       bool isOneByteString=true;
       for (int i=0; i<value.length; i++) {
  
positive.code:     }  
    } 
    writeList(value, type, subtype) {
      writeTypeAndLength(_LIST_GENERIC, value.length);
      for (int i=0; i<value.length; i++)
        writeGeneric(value[i], type, subtype);
    }
    writeListInt(value) {
      writeTypeAndLength(_LIST_INT, value.length);
      
      for (int i=0; i<value.length; i++)
        writeInt(value[i]);
    }
    writeListString(value) {
      writeTypeAndLength(_LIST_STRING, value.length);
      
      for (int i=0; i<value.length; i++)
        writeString(value[i]);
    }
    writeMap(value, type, subtype) {
      writeTypeAndLength(_MAP_GENERIC, value.length);
      value.forEach((k,v){ writeString(k); writeGeneric(v, type, subtype); });
    }
    writeGeneric(value, type, subtype) {
      if (value==null) {
        buf[bufPos++]=0; // type=0 is null
        return;
      }
  
negative.code: 
    }
    writeDouble(value) {
      _ensureSpace(9);
      writeType(_DOUBLE);
      throw "not implemented";
      //buf.setFloat64(bufPos,value,  Endianness.HOST_ENDIAN);
      //bufPos+=8; 
    } 
    writeBool(value) {
      _ensureSpace(2);
      writeType(_BOOL);
      buf[bufPos++]= value?1:0;
    }
    writeTypeAndLength(type, length) {
      buf[bufPos++]=type&0x1F;
      if (length<=255) {
        buf[bufPos++] = length;
        return;
  