We are using this interface only for local variable type declaration,
use CRC32 directly, just as MappedJournalSegmentWriter does.
JIRA: CONTROLLER-2095
Change-Id: I054c639ae49b4fccef863a363c6e8665ea1322f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.zip.CRC32;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.zip.CRC32;
-import java.util.zip.Checksum;
final long checksum = memory.getInt() & 0xFFFFFFFFL;
// Compute the checksum for the entry bytes.
final long checksum = memory.getInt() & 0xFFFFFFFFL;
// Compute the checksum for the entry bytes.
- final Checksum crc32 = new CRC32();
+ final CRC32 crc32 = new CRC32();
crc32.update(memory.array(), memory.position(), length);
// If the stored checksum equals the computed checksum, return the entry.
crc32.update(memory.array(), memory.position(), length);
// If the stored checksum equals the computed checksum, return the entry.
}
// Compute the checksum for the entry.
}
// Compute the checksum for the entry.
- final Checksum crc32 = new CRC32();
+ final CRC32 crc32 = new CRC32();
crc32.update(memory.array(), Integer.BYTES + Integer.BYTES, memory.limit() - (Integer.BYTES + Integer.BYTES));
final long checksum = crc32.getValue();
crc32.update(memory.array(), Integer.BYTES + Integer.BYTES, memory.limit() - (Integer.BYTES + Integer.BYTES));
final long checksum = crc32.getValue();