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),
sizeof(val));
87 #endif // INCLUDE_OLA_IO_OUTPUTSTREAM_H_