public class BitReader
extends java.lang.Object
예를 들면, 압축된 데이터 스트림에서 각각 비트를 읽거나, 특정 비트 수만큼 데이터를 읽어올 수 있다.
| Constructor and Description |
|---|
BitReader(byte[] data)
BitReader 생성자.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext()
스트림에 읽을 데이터가 남아있는지 확인한다.
|
long |
readBit()
한 비트를 읽어오는 메서드.
|
long |
readBits(int numBits)
지정된 비트 수만큼 데이터를 읽어온다.
|
public BitReader(byte[] data)
data - 비트 단위로 읽어올 바이트 배열public boolean hasNext()
public long readBit()
throws java.io.IOException
java.io.IOException - 스트림에서 데이터를 읽는 중 오류가 발생하거나, 스트림의 끝에 도달한 경우public long readBits(int numBits)
throws java.io.IOException
numBits - 읽어올 비트 수java.io.IOException - 스트림에서 데이터를 읽는 중 오류가 발생한 경우