streamsize in_avail();
If a read position is available, the member function returns egptr() - gptr(). Otherwise, it returns showmanyc().
egptr
() -
gptr
()
showmanyc