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

pack-priv final Class Bzip2BitWriter

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

A bit writer that allows the writing of single bit booleans, unary numbers, bit strings of arbitrary length (up to 32 bits), and bit aligned 32-bit integers. A single byte at a time is written to the Buffer when sufficient bits have been accumulated.

Field Summary

Modifier and TypeField and Description
private long
bitBuffer

A buffer of bits waiting to be written to the output stream.

private int
bitCount

The number of bits currently buffered in bitBuffer.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
flush(Buffer out)

Writes any remaining bits to the output Buffer, zero padding to a whole byte as required.

pack-priv void
writeBits(Buffer out, final int
The number of bits to write (maximum 32 as a size of int)
count
,
final long
The bits to write
value
)

Writes up to 32 bits to the output Buffer.

pack-priv void
writeBoolean(Buffer out, final boolean
The bit to write
value
)

Writes a single bit to the output Buffer.

pack-priv void
writeInt(Buffer out, final int
The integer to write
value
)

Writes an integer as 32 bits to the output Buffer.

pack-priv void
writeUnary(Buffer out, int
The number of 1 to write
value
)

Writes a zero-terminated unary number to the output Buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bitBufferback to summary
private long bitBuffer

A buffer of bits waiting to be written to the output stream.

bitCountback to summary
private int bitCount

The number of bits currently buffered in bitBuffer.

Constructor Detail

Bzip2BitWriterback to summary
pack-priv Bzip2BitWriter()

Method Detail

flushback to summary
pack-priv void flush(Buffer out)

Writes any remaining bits to the output Buffer, zero padding to a whole byte as required.

writeBitsback to summary
pack-priv void writeBits(Buffer out, final int count, final long value)

Writes up to 32 bits to the output Buffer.

Parameters
count:int

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

value:long

The bits to write

writeBooleanback to summary
pack-priv void writeBoolean(Buffer out, final boolean value)

Writes a single bit to the output Buffer.

Parameters
value:boolean

The bit to write

writeIntback to summary
pack-priv void writeInt(Buffer out, final int value)

Writes an integer as 32 bits to the output Buffer.

Parameters
value:int

The integer to write

writeUnaryback to summary
pack-priv void writeUnary(Buffer out, int value)

Writes a zero-terminated unary number to the output Buffer. Example of the output for value = 6: 1111110

Parameters
value:int

The number of 1 to write