code: func (r *lengthDelimitedFrameReader) Read(data []byte) (int, error) {
  	if r.remaining <= 0 {
  		header := [4]byte{}
  		n, err := io.ReadAtLeast(r.r, header[:4], 4)
  		if err != nil {
  			return 0, err
  		}
  		if n != 4 {
  			return 0, io.ErrUnexpectedEOF
  		}
  		frameLength := int(binary.BigEndian.Uint32(header[:]))
  		r.remaining = frameLength
  	}
  
  	expect := r.remaining
  	max := expect
  	if max > len(data) {
  		max = len(data)
  	}
  	n, err := io.ReadAtLeast(r.r, data[:max], int(max))
  	r.remaining -= n
  	if err == io.ErrShortBuffer || r.remaining > 0 {
  		return n, io.ErrShortBuffer
  	}
  	if err != nil {
  		return n, err
  	}
  	if n != expect {
  		return n, io.ErrUnexpectedEOF
  	}
  
  	return n, nil
  }
docs: // Read attempts to read an entire frame into data. If that is not possible, io.ErrShortBuffer
  // is returned and subsequent calls will attempt to read the last frame. A frame is complete when
  // err is nil.