func NewDelimitedReader(r io.Reader, maxSize int) ReadCloser {
	var closer io.Closer
	if c, ok := r.(io.Closer); ok {
		closer = c
	}
	return &varintReader{r, nil, maxSize, closer}
}
NewDelimitedReader reads varint-delimited Protobuf messages from a reader.
Unlike the gogoproto NewDelimitedReader, this does not buffer the reader,
which may cause poor performance but is necessary when only reading single
messages (e.g. in the p2p package). It also returns the number of bytes
read, which is necessary for the p2p package.
package protoio
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"io"
	"github.com/gogo/protobuf/proto"
)