Class FastCrc
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.wal.crc.FastCrc
-
public final class FastCrc extends Object
This CRC calculation implementation workf much faster thenPureJavaCrc32
-
-
Constructor Summary
Constructors Constructor Description FastCrc()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intcalcCrc(File file)static intcalcCrc(ByteBuffer buf, int len)intgetValue()voidreset()Preparation for further calculations.voidupdate(ByteBuffer buf, int len)
-
-
-
Method Detail
-
reset
public void reset()
Preparation for further calculations.
-
getValue
public int getValue()
- Returns:
- crc value.
-
update
public void update(ByteBuffer buf, int len)
- Parameters:
buf- Input buffer.len- Data length.
-
calcCrc
public static int calcCrc(ByteBuffer buf, int len)
- Parameters:
buf- Input buffer.len- Data length.- Returns:
- Crc checksum.
-
calcCrc
public static int calcCrc(File file) throws IOException
- Parameters:
file- A file to calculate checksum over it.- Returns:
- CRC32 checksum.
- Throws:
IOException- If fails.
-
-