ByteBuffer and CRC

Hello guys!I'm not good in Java ... Can some one help me?I need to create CRC32 for bytebuffer.Then i need to put this CRC to last 4 bytes of this bye buffer.How to do this?
[209 byte] By [charlyya] at [2007-10-1 20:27:55]
# 1
Use the java.util.zip.CRC32 class to sum the data and then break the 32 value into 4 bytes and add it to the buffer.
Peter-Lawreya at 2007-7-13 2:27:45 > top of Java-index,Administration Tools,Sun Connection...
# 2

I calculate CRC using this code:

private float CreateCRC(ByteBuffer bb)

{

CRC32 checksum=new CRC32();

for(int i=0;i<bb.capacity()-4;i++)

{

checksum.update(bb.get(i));

}

return checksum.getValue();

}

Then I add value to last 4 bytes of buffer. Is this right way?>

charlyya at 2007-7-13 2:27:45 > top of Java-index,Administration Tools,Sun Connection...