-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRC-32 #191
Conversation
…urther tests will not be affected
…onstructor private)
…irect ByteBuffer's contents
import java.lang.reflect.Method; | ||
import java.util.zip.CRC32; | ||
|
||
public final class CrcUtil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better name may be Checksums
.
manifest.attributes('Main-Class': 'org.openjdk.jmh.Main') | ||
} | ||
|
||
uploadArchives { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't publish benchmarks.
* @param length of the data from which CRC-32 checksum should be computed. | ||
* @return CRC-32 checksum. | ||
*/ | ||
public static int crc32DirectByteBuffer(final int crc, final long address, final int offset, final int length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crc32
is sufficient as a name. The address does not need to be for a direct ByteBuffer
.
This PR adds
CrcUtil
class that allows computing CRC-32 checksum from a direct ByteBuffer's content without modifying any of the ByteBuffer state.