// DecodeBinary reads the payload from its binary representation.
511124
func (pl *Payload) DecodeBinary(dec *gob.Decoder) error {
	return dec.Decode(pl)
}
1218598
func (e *Epoch) MarshalBinary() (data []byte, err error) {
	b := make([]byte, 8)
	binary.LittleEndian.PutUint64(b[:], e.Time)
	b[7] = e.Level
	return b, nil
}
1095744
func decodeUUIDBinary(src []byte) ([]byte, error) {
	if len(src) != 16 {
		return nil, fmt.Errorf("pq: unable to decode uuid; bad length: %d", len(src))
	}

	dst := make([]byte, 36)
	dst[8], dst[13], dst[18], dst[23] = '-', '-', '-', '-'
	hex.Encode(dst[0:], src[0:4])
	hex.Encode(dst[9:], src[4:6])
	hex.Encode(dst[14:], src[6:8])
	hex.Encode(dst[19:], src[8:10])
	hex.Encode(dst[24:], src[10:16])

	return dst, nil
}
367413
func decodeBinaryString(s string) ([]byte, error) {
	if len(s)&7 != 0 {
		// prepend the padding
		s = strings.Repeat("0", 8-len(s)&7) + s
	}

	data := make([]byte, len(s)>>3)

	for i, dstIndex := 0, 0; i < len(s); i = i + 8 {
		value, err := strconv.ParseInt(s[i:i+8], 2, 0)
		if err != nil {
			return nil, fmt.Errorf("error while conversion: %s", err)
		}

		data[dstIndex] = byte(value)
		dstIndex++
	}

	return data, nil
}
609490
func (u Uint32) MarshalBinary() ([]byte, error) {
	b := uio.NewBigEndianBuffer(nil)
	b.Write32(uint32(u))
	return b.Data(), nil
}
137163
func IsBinary(r io.Reader) (bool, error) {
	reader := bufio.NewReader(r)
	c := 0
	for {
		if c == sniffLen {
			break
		}

		b, err := reader.ReadByte()
		if err == io.EOF {
			break
		}
		if err != nil {
			return false, err
		}

		if b == byte(0) {
			return true, nil
		}

		c++
	}

	return false, nil
}
1190047
func (m *Status) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
579126
func (m *SwaggerJSONWebKeySet) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
968677
func (v Value) MarshalBinary() ([]byte, error) {
	if v.IsNull() {
		return []byte{byte(NullType)}, nil
	}
	return v.Inner.MarshalBinary()
}
441299
func (o Options) MarshalBinary() ([]byte, error) {
	b := buffer.New(nil)
	for _, code := range o.sortedCodes() {
		for _, data := range o[code] {
			// 2 bytes: option code
			b.Write16(uint16(code))

			// 2 bytes: option length
			b.Write16(uint16(len(data)))

			// N bytes: option data
			b.WriteBytes(data)
		}
	}
	return b.Data(), nil
}
736789
func (src *Timestamp) EncodeBinary(ci *ConnInfo, buf []byte) ([]byte, error) {
	switch src.Status {
	case Null:
		return nil, nil
	case Undefined:
		return nil, errUndefined
	}
	if src.Time.Location() != time.UTC {
		return nil, errors.Errorf("cannot encode non-UTC time into timestamp")
	}

	var microsecSinceY2K int64
	switch src.InfinityModifier {
	case None:
		microsecSinceUnixEpoch := src.Time.Unix()*1000000 + int64(src.Time.Nanosecond())/1000
		microsecSinceY2K = microsecSinceUnixEpoch - microsecFromUnixEpochToY2K
	case Infinity:
		microsecSinceY2K = infinityMicrosecondOffset
	case NegativeInfinity:
		microsecSinceY2K = negativeInfinityMicrosecondOffset
	}

	return pgio.AppendInt64(buf, microsecSinceY2K), nil
}
816011
func (f *Frame) MarshalBinary() ([]byte, error) {
	b := make([]byte, f.length())
	_, err := f.read(b)
	return b, err
}
1247777
func (n *NII) MarshalBinary() ([]byte, error) {
	b := make([]byte, 3)

	b[0] = n.Type
	b[1] = n.Major
	b[2] = n.Minor

	return b, nil
}
227222
func DecodeIfBinaryToBytes(in []byte) []byte {
	if binaryFmt(in) {
		var b bytes.Buffer
		Cbor2JsonManyObjects(bytes.NewReader(in), &b)
		return b.Bytes()
	}
	return in
}
995239
func (m *Swaggeroauth2TokenParameters) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
348466
func (m *StatusResponseCilium) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
184540
func (p NewChannelAnsPayload) MarshalBinary() ([]byte, error) {
	var b byte
	if p.ChannelFrequencyOK {
		b = (1 << 0)
	}
	if p.DataRateRangeOK {
		b = b ^ (1 << 1)
	}
	return []byte{b}, nil
}