OpenV2G
Functions
BitOutputStream.h File Reference

Bit Output Stream. More...

#include <stdint.h>
#include "EXITypes.h"

Go to the source code of this file.

Functions

int writeBits (bitstream_t *stream, size_t nbits, uint32_t bits)
 Write bits. More...
 
int flush (bitstream_t *stream)
 Flush output. More...
 

Detailed Description

Bit Output Stream.

Write bits and bytes to an underlying output stream.

Function Documentation

◆ flush()

int flush ( bitstream_t stream)

Flush output.

If there are some unwritten bits, pad them if necessary and write them out. Note that this method does flush the underlying stream.

Parameters
streamOutput Stream
Returns
Error-Code <> 0

Flush output

◆ writeBits()

int writeBits ( bitstream_t stream,
size_t  nbits,
uint32_t  bits 
)

Write bits.

Write the n least significant bits of parameter b starting with the most significant, i.e. from left to right.

Parameters
streamOutput Stream
nbitsNumber of bits
bitsvalue
Returns
Error-Code <> 0