I'm trying to implement a method , calculating the CRC and adding it to a input- bitstring . For this I have found the CRC32 class in Java. Since I'm not familiar with this subject, I'm not sure how i can add the CRC. The getValue() method of CRC32 would return a long type, but adding a long to a bitstring makes not much of sense.
public byte[] getData() {
byte[] bytes = bits.toByteArray();
return bytes ;
}
public void addCRC() {
crc = new CRC32();
crc.update(getData(), 0, getBitArrayLength());
long crcLong = crc.getValue();
}