21 #ifndef INCLUDE_OLA_IO_OUTPUTSTREAM_H_
22 #define INCLUDE_OLA_IO_OUTPUTSTREAM_H_
25 #include <ola/io/OutputBuffer.h>
39 virtual void Write(
const uint8_t *data,
unsigned int length) = 0;
62 void Write(
const uint8_t *data,
unsigned int length) {
63 m_buffer->Write(data, length);
66 OutputStream& operator<<(uint8_t val) {
return Write(val); }
67 OutputStream& operator<<(uint16_t val) {
return Write(val); }
68 OutputStream& operator<<(uint32_t val) {
return Write(val); }
69 OutputStream& operator<<(int8_t val) {
return Write(val); }
70 OutputStream& operator<<(int16_t val) {
return Write(val); }
71 OutputStream& operator<<(int32_t val) {
return Write(val); }
78 m_buffer->Write(reinterpret_cast<const uint8_t*>(&val),
79 static_cast<unsigned int>(
sizeof(val)));
88 #endif // INCLUDE_OLA_IO_OUTPUTSTREAM_H_
Definition: OutputStream.h:34
Definition: OutputBuffer.h:36
Definition: OutputStream.h:53
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44