read() and peek() in cbuf.h hast return type char this is wrong! need to be int int read() int peek() if not readBytesUntil for example is not working.