Skip to content

Commit

Permalink
Addressing feedback from dec 5 - part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-puligundla committed Jan 31, 2024
1 parent 67ad384 commit 3233e39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package htsjdk.samtools.cram.compression.nametokenisation;

import htsjdk.samtools.cram.compression.CompressionUtils;
import htsjdk.samtools.cram.compression.nametokenisation.tokens.EncodeToken;
import htsjdk.samtools.cram.compression.range.RangeEncode;
import htsjdk.samtools.cram.compression.range.RangeParams;
Expand All @@ -16,8 +17,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static htsjdk.samtools.cram.compression.rans.Utils.writeUint7;

public class NameTokenisationEncode {

private int maxToken;
Expand Down Expand Up @@ -267,7 +266,7 @@ protected void serializeByteStreams(
if (tokenStream.get(tokenType).remaining() > 0) {
outBuffer.put((byte) (tokenType + ((tokenType == 0) ? 128 : 0)));
ByteBuffer tempOutByteBuffer = tryCompress(tokenStream.get(tokenType), useArith);
writeUint7(tempOutByteBuffer.limit(),outBuffer);
CompressionUtils.writeUint7(tempOutByteBuffer.limit(),outBuffer);
outBuffer.put(tempOutByteBuffer);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package htsjdk.samtools.cram.compression.nametokenisation;

import htsjdk.samtools.cram.CRAMException;
import htsjdk.samtools.cram.compression.CompressionUtils;
import htsjdk.samtools.cram.compression.range.RangeDecode;
import htsjdk.samtools.cram.compression.rans.RANSDecode;
import htsjdk.samtools.cram.compression.rans.Utils;
import htsjdk.samtools.cram.compression.rans.ransnx16.RANSNx16Decode;

import java.nio.ByteBuffer;
Expand Down Expand Up @@ -98,7 +98,7 @@ public TokenStreams(final ByteBuffer inputByteBuffer, final int useArith, final
final ByteBuffer dupTokenStream = tokenStreams.get(dupType).get(dupPosition).duplicate();
tokenStreams.get(tokenType).add(tokenPosition,dupTokenStream);
} else {
final int clen = Utils.readUint7(inputByteBuffer);
final int clen = CompressionUtils.readUint7(inputByteBuffer);
final byte[] dataBytes = new byte[clen];
inputByteBuffer.get(dataBytes, 0, clen); // offset in the dst byte array
final ByteBuffer uncompressedDataByteBuffer;
Expand Down

0 comments on commit 3233e39

Please sign in to comment.