Standard C++ Library Reference ISO/IEC (VERSION3)

If putptr is a null pointer, the function establishes just an input buffer, by executing:
setg(getptr, getptr, getptr + N);
Otherwise, it establishes both input and output buffers, by executing:
setg(getptr, getptr, putptr);
setp(putptr, getptr + N);
In this case, putptr must be in the interval [getptr, getptr + N].
Finally, the three constructors:
strstreambuf(const char *getptr, streamsize count);
strstreambuf(const signed char *getptr, streamsize count);
strstreambuf(const unsigned char *getptr, streamsize count);
all behave the same as:
streambuf((char *)getptr, count);
except that the stored mode makes the controlled sequence neither modifiable not extendable.
strstreambuf::underflow
virtual int underflow();
The protected virtual member function endeavors to extract the current element ch from the
input buffer, then advance the current stream position, and return the element as
(int)(unsigned char)ch. It can do so in only one way: If a read position is available, it
takes ch as the element stored in the read position and advances the next pointer for the input
buffer.
If the function cannot succeed, it returns EOF. Otherwise, it returns the current element in the
input stream, converted as described above.
istrstream
class istrstream : public istream {
public:
explicit istrstream(const char *ptr);
explicit istrstream(char *ptr);
istrstream(const char *ptr, streamsize count);
istrstream(char *ptr, streamsize count);
strstreambuf *rdbuf() const;
char *str();
};