This function dumps a lot of information about a stream into the provided buffer. It is now used by stream_dump_and_crash() and will be used by the debugger as well.