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

pack-priv final Class Bzip2BitWriter

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBuf

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 ByteBuf 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(ByteBuf out)

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

pack-priv void
writeBits(ByteBuf 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 ByteBuf.

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

Writes a single bit to the output ByteBuf.

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

Writes an integer as 32 bits to the output ByteBuf.

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

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

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(ByteBuf out)

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

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

Writes up to 32 bits to the output ByteBuf.

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(ByteBuf out, final boolean value)

Writes a single bit to the output ByteBuf.

Parameters
value:boolean

The bit to write

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

Writes an integer as 32 bits to the output ByteBuf.

Parameters
value:int

The integer to write

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

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

Parameters
value:int

The number of 1 to write