buffer.putInt(req.getData().length);
int checkSum = CheckSum.crc32(req.getData());
// If client passes checksum,compare them
if (req.getCheckSum() != -1) {
if (checkSum != req.getCheckSum()) {
throw new InvalidCheckSumException(
"Checksum failure,message may be corrupted when transfering on networking.");
}
}
buffer.putInt(checkSum);
buffer.putLong(msgId);