func Read(reader io.Reader, version byte) (Packet, int, error) {

	var fh FixedHeader
	var n int
	var err error
	if n, err = fh.Read(reader); err != nil {
		return nil, n, err
	}

	buf := make([]byte, fh.Length)

	d, err := io.ReadFull(reader, buf)
	n += d
	if err != nil {
		return nil, n, err
	}

	pkt, err := readPacket(&fh, buf, version)
	return pkt, n, err
}
// Read reads a packet from an io.Reader.
Read reads a packet from an io.Reader.
// Read reads a packet from an io . Reader .
func Read(reader io.Reader, version byte) (Packet, int, error) {
	var fh FixedHeader
	var n int
	var err error
	if n, err = fh.Read(reader); err != nil {
		return nil, n, err
	}
	buf := make([]byte, fh.Length)
	d, err := io.ReadFull(reader, buf)
	n += d
	if err != nil {
		return nil, n, err
	}
	pkt, err := readPacket(&fh, buf, version)
	return pkt, n, err
}
func Read ( reader io . Reader , version byte ) ( Packet , int , error ) { var fh FixedHeader var n int var err error if n , err = fh . Read ( reader ) ; err != nil { return nil , n , err } buf := make ( [ ] byte , fh . Length ) d , err := io . ReadFull ( reader , buf ) n += d if err != nil { return nil , n , err } pkt , err := readPacket ( & fh , buf , version ) return pkt , n , err }
Read reads a packet from an io.Reader.
Read reads a packet from an io . Reader .