func ExpectBytes(r io.Reader, want []byte) error {
	got := make([]byte, len(want))
	if _, err := io.ReadFull(r, got); err != nil {
		return fmt.Errorf("reading bytes: %v", err)
	}
	if !bytes.Equal(got, want) {
		return fmt.Errorf("comparing bytes: got %q, want %q", got, want)
	}
	return nil
}
ExpectBytes reads len(want) bytes from r and returns an error on mismatch.
package binary
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"io"
)