31 #ifndef BITREADERWRITER_H_ 32 #define BITREADERWRITER_H_ 53 static std::vector<uint8_t>
getPosition(
const std::vector<uint8_t>& data, uint32_t position, uint32_t size);
63 static std::vector<uint8_t>
getPosition(
const std::vector<char>& data, uint32_t position, uint32_t size);
73 static uint8_t
getPosition8(
const std::vector<uint8_t>& data, uint32_t position, uint32_t size);
83 static uint16_t
getPosition16(
const std::vector<uint8_t>& data, uint32_t position, uint32_t size);
93 static uint32_t
getPosition32(
const std::vector<uint8_t>& data, uint32_t position, uint32_t size);
103 static uint64_t
getPosition64(
const std::vector<uint8_t>& data, uint32_t position, uint32_t size);
113 static void setPositionLE(uint32_t position, uint32_t size, std::vector<uint8_t>& target,
const std::vector<uint8_t>& source);
123 static void setPositionLE(uint32_t position, uint32_t size, std::vector<char>& target,
const std::vector<uint8_t>& source);
133 static void setPositionBE(uint32_t position, uint32_t size, std::vector<uint8_t>& target,
const std::vector<uint8_t>& source);
143 static void setPositionBE(uint32_t position, uint32_t size, std::vector<char>& target,
const std::vector<uint8_t>& source);
145 static const uint8_t _bitMaskGet[8];
146 static const uint8_t _bitMaskSetSource[9];
147 static const uint8_t _bitMaskSetTargetStart[8];
148 static const uint8_t _bitMaskSetTargetEnd[8];
Definition: BitReaderWriter.h:40
static std::vector< uint8_t > getPosition(const std::vector< uint8_t > &data, uint32_t position, uint32_t size)
Reads any number of bits at any position from a byte array.
Definition: BitReaderWriter.cpp:43
Definition: BaseLib.cpp:34
static uint8_t getPosition8(const std::vector< uint8_t > &data, uint32_t position, uint32_t size)
Reads up to 8 bits at any position from a byte array and returns it as an uint8_t.
Definition: BitReaderWriter.cpp:161
static uint32_t getPosition32(const std::vector< uint8_t > &data, uint32_t position, uint32_t size)
Reads up to 32 bits at any position from a byte array and returns it as an uint32_t.
Definition: BitReaderWriter.cpp:223
static uint64_t getPosition64(const std::vector< uint8_t > &data, uint32_t position, uint32_t size)
Reads up to 64 bits at any position from a byte array and returns it as an uint64_t.
Definition: BitReaderWriter.cpp:258
virtual ~BitReaderWriter()
static void setPositionLE(uint32_t position, uint32_t size, std::vector< uint8_t > &target, const std::vector< uint8_t > &source)
Sets any number of bits at any position in a byte array.
Definition: BitReaderWriter.cpp:293
static uint16_t getPosition16(const std::vector< uint8_t > &data, uint32_t position, uint32_t size)
Reads up to 16 bits at any position from a byte array and returns it as an uint16_t.
Definition: BitReaderWriter.cpp:187
static void setPositionBE(uint32_t position, uint32_t size, std::vector< uint8_t > &target, const std::vector< uint8_t > &source)
Sets any number of bits at any position in a byte array.
Definition: BitReaderWriter.cpp:409