Skip to main content
2 of 4
added 30 characters in body
Juraj
  • 18.3k
  • 4
  • 32
  • 50

The Stream class has pure virtual methods which must be implemented in derived not abstract class.

The pure virtual method from base class Print is:

virtual size_t write(uint8_t) = 0;

The pure virtual methods from Stream are:

virtual int available() = 0;
virtual int read() = 0;
virtual int peek() = 0;

additionally add in your class line

using Print::write; 

to pull in overloaded methods write(str) and write(buf, size) fromPrint

Here I have an example of a simple class derived from Stream.

Juraj
  • 18.3k
  • 4
  • 32
  • 50