// NewFramer returns a Framer that writes frames to w and reads them from r.
NewFramer returns a Framer that writes frames to w and reads them from r.
// NewFramer returns a Framer that writes frames to w and reads them from r .
func NewFramer(w io.Writer, r io.Reader) *Framer {
	fr := &Framer{
		r: r,
	}
	fr.w = stickyErrWriter{w, &fr.werr}
	fr.getReadBuf = func(size uint32) []byte {
		if cap(fr.readBuf) >= int(size) {
			return fr.readBuf[:size]
		}
		fr.readBuf = make([]byte, size)
		return fr.readBuf
	}
	return fr
}
func NewFramer ( w io . Writer , r io . Reader ) * Framer { fr := & Framer { r : r , } fr . w = stickyErrWriter { w , & fr . werr } fr . getReadBuf = func ( size uint32 ) [ ] byte { if cap ( fr . readBuf ) >= int ( size ) { return fr . readBuf [ : size ] } fr . readBuf = make ( [ ] byte , size ) return fr . readBuf } return fr }
NewFramer returns a Framer that writes frames to w and reads them from r.
NewFramer returns a Framer that writes frames to w and reads them from r .