Package htsjdk.samtools.cram.compression
Class CompressionUtils
java.lang.Object
htsjdk.samtools.cram.compression.CompressionUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteBufferallocateByteBuffer(int bufferSize) static ByteBufferallocateOutputBuffer(int inSize) static ByteBufferdecodePack(ByteBuffer inBuffer, byte[] packMappingTable, int numSymbols, int uncompressedPackOutputLength) static ByteBufferencodePack(ByteBuffer inBuffer, ByteBuffer outBuffer, int[] frequencyTable, int[] packMappingTable, int numSymbols) static intreadUint7(ByteBuffer cp) static ByteBufferslice(ByteBuffer inputBuffer) static byte[]toByteArray(ByteBuffer buffer) Return a byte array with a size that matches the limit of the provided ByteBuffer.static ByteBufferwrap(byte[] inputBytes) static voidwriteUint7(int i, ByteBuffer cp)
-
Constructor Details
-
CompressionUtils
public CompressionUtils()
-
-
Method Details
-
writeUint7
-
readUint7
-
encodePack
public static ByteBuffer encodePack(ByteBuffer inBuffer, ByteBuffer outBuffer, int[] frequencyTable, int[] packMappingTable, int numSymbols) -
decodePack
public static ByteBuffer decodePack(ByteBuffer inBuffer, byte[] packMappingTable, int numSymbols, int uncompressedPackOutputLength) -
allocateOutputBuffer
-
allocateByteBuffer
-
wrap
-
slice
-
toByteArray
Return a byte array with a size that matches the limit of the provided ByteBuffer. If the ByteBuffer is backed by a byte array that matches the limit of the ByteBuffer, the backing array will be returned directly. Otherwise, copy the contents of the ByteBuffer into a new byte array and return the new byte array.- Parameters:
buffer- input ByteBuffer which is the source of the byte array- Returns:
- A byte array. If the ByteBuffer is backed by a byte array that matches the limit of the ByteBuffer, return the backing array directly. Otherwise, copy the contents of the ByteBuffer into a new byte array.
-