(bit-writer) Do not clear buffer when creating a bit writer

This commit is contained in:
Viktor Lofgren 2024-09-29 17:52:43 +02:00
parent 43ca9c8a12
commit 2b8ab97ec1
2 changed files with 2 additions and 2 deletions

View File

@ -149,6 +149,8 @@ public class GammaCodedSequence implements Iterable<Integer>, CodedSequence {
* or equal to zero.
*/
public static ByteBuffer encode(ByteBuffer workArea, IntList sequence) {
workArea.clear();
var writer = new BitWriter(workArea);
writer.putGamma(sequence.size() + 1);

View File

@ -23,8 +23,6 @@ public class BitWriter {
this.bitPosition = 0;
this.currentValue = 0;
this.totalMeaningfulBytes = 0;
underlying.clear();
}
public void putBit(boolean value) {