func ReadUint16(r io.Reader) (uint16, error) {
	var v uint16
	if err := binary.Read(r, binary.BigEndian, &v); err != nil {
		return 0, err
	}
	return v, nil
}
ReadUint16 reads 2 bytes and returns them as a BigEndian uint16
package binary
import (
	"bufio"
	"encoding/binary"
	"io"
	"gopkg.in/src-d/go-git.v4/plumbing"
)
func Read(r io.Reader, data ...interface{}) error {
	for _, v := range data {
		if err := binary.Read(r, binary.BigEndian, v); err != nil {
			return err
		}
	}
	return nil
}
func ReadUntil(r io.Reader, delim byte) ([]byte, error) {
	var buf [1]byte
	value := make([]byte, 0, 16)
	for {
		if _, err := io.ReadFull(r, buf[:]); err != nil {
			if err == io.EOF {
				return nil, err
			}
			return nil, err
		}
		if buf[0] == delim {
			return value, nil
		}
		value = append(value, buf[0])
	}
}
func ReadVariableWidthInt(r io.Reader) (int64, error) {
	var c byte
	if err := Read(r, &c); err != nil {
		return 0, err
	}
	var v = int64(c & maskLength)
	for c&maskContinue > 0 {
		v++
		if err := Read(r, &c); err != nil {
			return 0, err
		}
		v = (v << lengthBits) + int64(c&maskLength)
	}
	return v, nil
}
const (
	maskContinue = uint8(128)  
	maskLength   = uint8(127)  
	lengthBits   = uint8(7)    
)
func ReadUint64(r io.Reader) (uint64, error) {
	var v uint64
	if err := binary.Read(r, binary.BigEndian, &v); err != nil {
		return 0, err
	}
	return v, nil
}
func ReadUint32(r io.Reader) (uint32, error) {
	var v uint32
	if err := binary.Read(r, binary.BigEndian, &v); err != nil {
		return 0, err
	}
	return v, nil
}