Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ private static final class ChecksumCalculator {
private final MessageDigest digest;
private ByteBuffer buffer;
private ByteBuffer float64Buffer;
private CharsetEncoder encoder;
Comment thread
olavloite marked this conversation as resolved.

ChecksumCalculator() {
try {
Expand Down Expand Up @@ -338,7 +339,11 @@ private void putString(String stringValue) {
// creating a new copy of (a part of) the string. E.g. using something like substring(..)
// would create a copy of that part of the string, using CharBuffer.wrap(..) does not.
CharBuffer source = CharBuffer.wrap(stringValue);
CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder();
if (encoder == null) {
encoder = StandardCharsets.UTF_8.newEncoder();
} else {
encoder.reset();
}
Comment thread
olavloite marked this conversation as resolved.
// source.hasRemaining() returns false when all the characters in the string have been
// processed.
while (source.hasRemaining()) {
Expand Down
Loading