Package de.jarnbjo.util.io
Class ByteArrayBitInputStream
java.lang.Object
de.jarnbjo.util.io.ByteArrayBitInputStream
- All Implemented Interfaces:
BitInputStream
public class ByteArrayBitInputStream extends java.lang.Object implements BitInputStream
-
Field Summary
Fields inherited from interface de.jarnbjo.util.io.BitInputStream
BIG_ENDIAN, LITTLE_ENDIAN
-
Constructor Summary
Constructors Constructor Description ByteArrayBitInputStream(byte[] source)
ByteArrayBitInputStream(byte[] source, int endian)
-
Method Summary
Modifier and Type Method Description void
align()
boolean
getBit()
int
getInt(int bits)
int
getInt(HuffmanNode root)
long
getLong(int bits)
int
getSignedInt(int bits)
byte[]
getSource()
int
readSignedRice(int order)
void
readSignedRice(int order, int[] buffer, int off, int len)
void
setEndian(int endian)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ByteArrayBitInputStream
public ByteArrayBitInputStream(byte[] source) -
ByteArrayBitInputStream
public ByteArrayBitInputStream(byte[] source, int endian)
-
-
Method Details
-
getBit
public boolean getBit() throws java.io.IOException- Specified by:
getBit
in interfaceBitInputStream
- Throws:
java.io.IOException
-
getInt
public int getInt(int bits) throws java.io.IOException- Specified by:
getInt
in interfaceBitInputStream
- Throws:
java.io.IOException
-
getSignedInt
public int getSignedInt(int bits) throws java.io.IOException- Specified by:
getSignedInt
in interfaceBitInputStream
- Throws:
java.io.IOException
-
getInt
- Specified by:
getInt
in interfaceBitInputStream
- Throws:
java.io.IOException
-
getLong
public long getLong(int bits) throws java.io.IOException- Specified by:
getLong
in interfaceBitInputStream
- Throws:
java.io.IOException
-
readSignedRice
public int readSignedRice(int order) throws java.io.IOException- Specified by:
readSignedRice
in interfaceBitInputStream
- Throws:
java.io.IOException
-
readSignedRice
public void readSignedRice(int order, int[] buffer, int off, int len) throws java.io.IOException- Specified by:
readSignedRice
in interfaceBitInputStream
- Throws:
java.io.IOException
-
align
public void align()- Specified by:
align
in interfaceBitInputStream
-
setEndian
public void setEndian(int endian)- Specified by:
setEndian
in interfaceBitInputStream
-
getSource
public byte[] getSource()
-