Add test for calculateCapacity
Issue: SPR-17558 Closes gh-2054
This commit is contained in:
committed by
Brian Clozel
parent
a00be62b04
commit
5a8b8b11e4
@@ -99,7 +99,7 @@ public final class CharSequenceEncoder extends AbstractEncoder<CharSequence> {
|
||||
});
|
||||
}
|
||||
|
||||
private int calculateCapacity(CharSequence sequence, Charset charset) {
|
||||
int calculateCapacity(CharSequence sequence, Charset charset) {
|
||||
float maxBytesPerChar = this.charsetToMaxBytesPerChar
|
||||
.computeIfAbsent(charset, cs -> cs.newEncoder().maxBytesPerChar());
|
||||
float maxBytesForSequence = sequence.length() * maxBytesPerChar;
|
||||
|
||||
Reference in New Issue
Block a user