Class BitBuffer
- java.lang.Object
-
- nom.tam.fits.compression.algorithm.rice.BitBuffer
-
public class BitBuffer extends java.lang.ObjectA bit wise reader writer around a bytebuffer.
-
-
Field Summary
Fields Modifier and Type Field Description private static intBITS_OF_1_BYTEprivate static intBITS_OF_2_BYTESprivate static intBITS_OF_3_BYTESprivate static intBITS_OF_4_BYTESprivate java.nio.ByteBufferbufferprivate static intBYTE_1_OF_INTprivate static intBYTE_2_OF_INTprivate static intBYTE_3_OF_INTprivate static intBYTE_4_OF_INTprivate static intBYTE_MASKprivate static longINTEGER_MASKprivate longposition
-
Constructor Summary
Constructors Constructor Description BitBuffer(java.nio.ByteBuffer writeBuffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbitbuffer()(package private) voidclose()intmissingBitsInCurrentByte()voidmovePosition(int i)voidputByte(byte byteToAdd)voidputByte(byte byteToAdd, int bits)voidputInt(int i)write out int value to the next 4 bytes of the buffervoidputInt(int i, int bits)voidputLong(long l, int bits)
-
-
-
Field Detail
-
BITS_OF_4_BYTES
private static final int BITS_OF_4_BYTES
- See Also:
- Constant Field Values
-
BYTE_MASK
private static final int BYTE_MASK
- See Also:
- Constant Field Values
-
INTEGER_MASK
private static final long INTEGER_MASK
- See Also:
- Constant Field Values
-
BITS_OF_1_BYTE
private static final int BITS_OF_1_BYTE
- See Also:
- Constant Field Values
-
BITS_OF_2_BYTES
private static final int BITS_OF_2_BYTES
- See Also:
- Constant Field Values
-
BITS_OF_3_BYTES
private static final int BITS_OF_3_BYTES
- See Also:
- Constant Field Values
-
BYTE_1_OF_INT
private static final int BYTE_1_OF_INT
- See Also:
- Constant Field Values
-
BYTE_2_OF_INT
private static final int BYTE_2_OF_INT
- See Also:
- Constant Field Values
-
BYTE_3_OF_INT
private static final int BYTE_3_OF_INT
- See Also:
- Constant Field Values
-
BYTE_4_OF_INT
private static final int BYTE_4_OF_INT
- See Also:
- Constant Field Values
-
buffer
private final java.nio.ByteBuffer buffer
-
position
private long position
-
-
Method Detail
-
bitbuffer
public int bitbuffer()
-
close
void close()
-
missingBitsInCurrentByte
public int missingBitsInCurrentByte()
-
movePosition
public void movePosition(int i)
-
putByte
public void putByte(byte byteToAdd)
-
putByte
public void putByte(byte byteToAdd, int bits)
-
putInt
public void putInt(int i)
write out int value to the next 4 bytes of the buffer- Parameters:
i- integer to write
-
putInt
public void putInt(int i, int bits)
-
putLong
public void putLong(long l, int bits)
-
-