private byte[] writeCheckedBytes(MessageNano proto){
  BackupProtos.CheckedMessage wrapper=new BackupProtos.CheckedMessage();
  wrapper.payload=MessageNano.toByteArray(proto);
  CRC32 checksum=new CRC32();
  checksum.update(wrapper.payload);
  wrapper.checksum=checksum.getValue();
  return MessageNano.toByteArray(wrapper);
}

private byte [ ] writeCheckedBytes ( MessageNano proto ) { BackupProtos . CheckedMessage wrapper = new BackupProtos . CheckedMessage ( ) ; wrapper . payload = MessageNano . toByteArray ( proto ) ; CRC32 checksum = new CRC32 ( ) ; checksum . update ( wrapper . payload ) ; wrapper . checksum = checksum . getValue ( ) ; return MessageNano . toByteArray ( wrapper ) ; }
wrap a proto in a checkedmessage and compute the checksum .
