func (l binaryFreeList) Uint16(r io.Reader, byteOrder binary.ByteOrder) (uint16, error) {
	buf := l.Borrow()[:2]
	if _, err := io.ReadFull(r, buf); err != nil {
		l.Return(buf)
		return 0, err
	}
	rv := byteOrder.Uint16(buf)
	l.Return(buf)
	return rv, nil
}
Uint16 reads two bytes from the provided reader using a buffer from the
free list, converts it to a number using the provided byte order, and returns
the resulting uint16.
package wire
import (
	"crypto/rand"
	"encoding/binary"
	"fmt"
	"io"
	"math"
)
const (
	MaxVarIntPayload = 9
	binaryFreeListMaxItems = 1024
)
var (
	littleEndian = binary.LittleEndian
	bigEndian = binary.BigEndian
)
type binaryFreeList chan []byte
func (l binaryFreeList) Borrow() []byte {
	var buf []byte
	select {
	case buf = <-l:
	default:
		buf = make([]byte, 8)
	}
	return buf[:8]
}
func (l binaryFreeList) Return(buf []byte) {
	select {
	case l <- buf:
	default:
	}
}
func (l binaryFreeList) Uint8(r io.Reader) (uint8, error) {
	buf := l.Borrow()[:1]
	if _, err := io.ReadFull(r, buf); err != nil {
		l.Return(buf)
		return 0, err
	}
	rv := buf[0]
	l.Return(buf)
	return rv, nil
}