57 return wrap(static_cast<uint16_t>(value), endianness);
60 return wrap(static_cast<uint32_t>(value), endianness);
63 return wrap(static_cast<uint64_t>(value), endianness);
94 std::vector<uint8_t>
get_vector(
size_t length);
98 void put_uint(uint64_t value,
size_t length);
106 void put_int16(int32_t value) { this->
put_uint(static_cast<uint16_t>(value),
sizeof(uint16_t)); }
108 void put_int32(int32_t value) { this->
put_uint(static_cast<uint32_t>(value),
sizeof(uint32_t)); }
109 void put_int64(int64_t value) { this->
put_uint(static_cast<uint64_t>(value),
sizeof(uint64_t)); }
114 void put_vector(
const std::vector<uint8_t> &value);
void put_uint32(uint32_t value)
void put_int8(int8_t value)
void set_limit(size_t limit)
void put_uint64(uint64_t value)
std::vector< uint8_t > data_
static ByteBuffer wrap(int64_t value, Endian endianness=LITTLE)
static ByteBuffer wrap(std::vector< uint8_t > const &data, Endian endianness=LITTLE)
Wrap an existing vector in a ByteBufffer.
std::vector< uint8_t > get_vector(size_t length)
std::vector< uint8_t > get_data()
void put_int64(int64_t value)
void put_uint8(uint8_t value)
Putters.
size_t get_position() const
static ByteBuffer wrap(bool value)
uint8_t get_uint8()
Getters.
void put_uint(uint64_t value, size_t length)
void put_int24(int32_t value)
void put_double(double value)
uint64_t get_uint(size_t length)
static ByteBuffer wrap(int32_t value, Endian endianness=LITTLE)
static ByteBuffer wrap(int8_t value)
void put_uint16(uint16_t value)
size_t get_capacity() const
void put_float(float value)
ByteBuffer(size_t capacity, Endian endianness=LITTLE)
Create a new Bytebuffer with the given capacity.
void put_int16(int32_t value)
size_t get_remaining() const
void set_position(size_t position)
static ByteBuffer wrap(int16_t value, Endian endianness=LITTLE)
Endian get_endianness() const
Implementation of SPI Controller mode.
void put_uint24(uint32_t value)
void put_int32(int32_t value)
A class modelled on the Java ByteBuffer class.
void put_vector(const std::vector< uint8_t > &value)
void put_bool(bool value)
ByteBuffer(std::vector< uint8_t > const &data)