code: func (stream *Stream) Flush() error {
  	if stream.out == nil {
  		return nil
  	}
  	if stream.Error != nil {
  		return stream.Error
  	}
  	n, err := stream.out.Write(stream.buf)
  	if err != nil {
  		if stream.Error == nil {
  			stream.Error = err
  		}
  		return err
  	}
  	stream.buf = stream.buf[n:]
  	return nil
  }
docs: // Flush writes any buffered data to the underlying io.Writer.