func ReadBuffer(buf []byte, version byte) (Packet, error) {

	var fh FixedHeader
	n, err := fh.ReadBuffer(buf)
	if err != nil {
		return nil, err
	}
	buf = buf[n:]
	if len(buf) != fh.Length {
		return nil, fmt.Errorf("invalid buffer length: header(%d) != buffer(%d)", fh.Length, len(buf))
	}
	return readPacket(&fh, buf, version)
}
// ReadBuffer reads a packet from the buffer.
ReadBuffer reads a packet from the buffer.
// ReadBuffer reads a packet from the buffer .
func ReadBuffer(buf []byte, version byte) (Packet, error) {
	var fh FixedHeader
	n, err := fh.ReadBuffer(buf)
	if err != nil {
		return nil, err
	}
	buf = buf[n:]
	if len(buf) != fh.Length {
		return nil, fmt.Errorf("invalid buffer length: header(%d) != buffer(%d)", fh.Length, len(buf))
	}
	return readPacket(&fh, buf, version)
}
func ReadBuffer ( buf [ ] byte , version byte ) ( Packet , error ) { var fh FixedHeader n , err := fh . ReadBuffer ( buf ) if err != nil { return nil , err } buf = buf [ n : ] if len ( buf ) != fh . Length { return nil , fmt . Errorf ( " " , fh . Length , len ( buf ) ) } return readPacket ( & fh , buf , version ) }
ReadBuffer reads a packet from the buffer.
ReadBuffer reads a packet from the buffer .