produces the following output:
31 HEXADECIMAL: 1F
The same approach can be used to write to other arbitrary destinations. For example, the constructor
of a stream buffer may take a file descriptor, the name of a socket connection, or two other stream
buffers used for simultaneous writing to initialize the object. Writing to the corresponding destination
requires only that overflow() be implemented. In addition, the function xsputn() should be
implemented to make writing to the stream buffer more efficient.