func ReadResponse(r *bufio.Reader, req *Request) (*Response, error) {
	var buf bytes.Buffer
	marshaledMessage, err := ioutil.ReadAll(io.TeeReader(r, &buf))
	if err != nil {
		return nil, err
	}
	extractor := message.NewSegmentExtractor(marshaledMessage)
	_, err = extractor.Extract()
	if err != nil {
		return nil, err
	}
	response := &Response{
		Request:           req,
		MarshaledResponse: marshaledMessage,
		SegmentExtractor:  extractor,
		Body:              ioutil.NopCloser(&buf),
	}
	return response, nil
}
// ReadResponse reads and returns a Response from r. It populates the embedded
// SegmentExtractor	to have it ready to use.
ReadResponse reads and returns a Response from r. It populates the embedded
SegmentExtractor	to have it ready to use.
// ReadResponse reads and returns a Response from r . It populates the embedded // SegmentExtractor to have it ready to use .
func ReadResponse(r *bufio.Reader, req *Request) (*Response, error) {
	var buf bytes.Buffer
	marshaledMessage, err := ioutil.ReadAll(io.TeeReader(r, &buf))
	if err != nil {
		return nil, err
	}
	extractor := message.NewSegmentExtractor(marshaledMessage)
	_, err = extractor.Extract()
	if err != nil {
		return nil, err
	}
	response := &Response{
		Request:           req,
		MarshaledResponse: marshaledMessage,
		SegmentExtractor:  extractor,
		Body:              ioutil.NopCloser(&buf),
	}
	return response, nil
}
func ReadResponse ( r * bufio . Reader , req * Request ) ( * Response , error ) { var buf bytes . Buffer marshaledMessage , err := ioutil . ReadAll ( io . TeeReader ( r , & buf ) ) if err != nil { return nil , err } extractor := message . NewSegmentExtractor ( marshaledMessage ) _ , err = extractor . Extract ( ) if err != nil { return nil , err } response := & Response { Request : req , MarshaledResponse : marshaledMessage , SegmentExtractor : extractor , Body : ioutil . NopCloser ( & buf ) , } return response , nil }
ReadResponse reads and returns a Response from r. It populates the embedded
SegmentExtractor	to have it ready to use.
ReadResponse reads and returns a Response from r . It populates the embedded SegmentExtractor to have it ready to use .