Top Description Fields Constructors Methods
io.netty5.handler.codec.compression

pack-priv Class Bzip2BitReader

extends Object
Class Inheritance
Imports
io.netty5.buffer.Buffer

An bit reader that allows the reading of single bit booleans, bit strings of arbitrary length (up to 32 bits), and bit aligned 32-bit integers. A single byte at a time is read from the Buffer when more bits are required.

Field Summary

Modifier and TypeField and Description
private long
bitBuffer

A buffer of bits read from the input stream that have not yet been returned.

private int
bitCount

The number of bits currently buffered in bitBuffer.

private Buffer
in

The Buffer from which to read data.

private static final int
MAX_COUNT_OF_READABLE_BYTES

Maximum count of possible readable bytes to check.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean

Returns:

true if count bits are available for reading, otherwise false
hasReadableBits
(int
The number of bits to check
count
)

Checks that the specified number of bits available for reading.

pack-priv boolean

Returns:

true if count bytes are available for reading, otherwise false
hasReadableBytes
(int
The number of bytes to check
count
)

Checks that the specified number of bytes available for reading.

pack-priv boolean

Returns:

true if one bit is available for reading, otherwise false
isReadable
()

Checks that at least one bit is available for reading.

pack-priv int

Returns:

The bits requested, right-aligned within the integer
readBits
(final int
The number of bits to read (maximum 32 as a size of int)
count
)

Reads up to 32 bits from the Buffer.

pack-priv boolean

Returns:

true if the bit read was 1, otherwise false
readBoolean
()

Reads a single bit from the Buffer.

pack-priv int

Returns:

The integer read
readInt
()

Reads 32 bits of input as an integer.

pack-priv void
refill()

Refill the Buffer by one byte.

pack-priv void
setBuffer(Buffer in)

Set the Buffer from which to read data.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bitBufferback to summary
private long bitBuffer

A buffer of bits read from the input stream that have not yet been returned.

bitCountback to summary
private int bitCount

The number of bits currently buffered in bitBuffer.

inback to summary
private Buffer in

The Buffer from which to read data.

MAX_COUNT_OF_READABLE_BYTESback to summary
private static final int MAX_COUNT_OF_READABLE_BYTES

Maximum count of possible readable bytes to check.

Constructor Detail

Bzip2BitReaderback to summary
pack-priv Bzip2BitReader()

Method Detail

hasReadableBitsback to summary
pack-priv boolean hasReadableBits(int count)

Checks that the specified number of bits available for reading.

Parameters
count:int

The number of bits to check

Returns:boolean

true if count bits are available for reading, otherwise false

hasReadableBytesback to summary
pack-priv boolean hasReadableBytes(int count)

Checks that the specified number of bytes available for reading.

Parameters
count:int

The number of bytes to check

Returns:boolean

true if count bytes are available for reading, otherwise false

isReadableback to summary
pack-priv boolean isReadable()

Checks that at least one bit is available for reading.

Returns:boolean

true if one bit is available for reading, otherwise false

readBitsback to summary
pack-priv int readBits(final int count)

Reads up to 32 bits from the Buffer.

Parameters
count:int

The number of bits to read (maximum 32 as a size of int)

Returns:int

The bits requested, right-aligned within the integer

readBooleanback to summary
pack-priv boolean readBoolean()

Reads a single bit from the Buffer.

Returns:boolean

true if the bit read was 1, otherwise false

readIntback to summary
pack-priv int readInt()

Reads 32 bits of input as an integer.

Returns:int

The integer read

refillback to summary
pack-priv void refill()

Refill the Buffer by one byte.

setBufferback to summary
pack-priv void setBuffer(Buffer in)

Set the Buffer from which to read data.