// GetBinaryField returns the value of BinaryField if it is set or its
// zero value if it is unset.
358514
func (v *CrazyNesting) GetBinaryField() (o []byte) {
	if v != nil && v.BinaryField != nil {
		return v.BinaryField
	}

	return
}
926388
func decodeBinary(rd *bufio.Reader) (string, Binary, error) {
	// name
	name, err := readCstring(rd)
	if err != nil {
		return "", nil, err
	}

	// value
	dataLen, err := readInt32(rd)
	if err != nil {
		return "", nil, err
	}

	// discard subtype
	_, err = rd.ReadByte()
	if err != nil {
		return "", nil, err
	}
	b := make([]byte, dataLen)
	_, err = io.ReadFull(rd, b)
	if err != nil {
		return "", nil, err
	}
	return name, Binary(b), nil
}
325422
func (p *point) MarshalBinary() ([]byte, error) {
	if len(p.fields) == 0 {
		return nil, ErrPointMustHaveAField
	}

	tb, err := p.time.MarshalBinary()
	if err != nil {
		return nil, err
	}

	b := make([]byte, 8+len(p.key)+len(p.fields)+len(tb))
	i := 0

	binary.BigEndian.PutUint32(b[i:], uint32(len(p.key)))
	i += 4

	i += copy(b[i:], p.key)

	binary.BigEndian.PutUint32(b[i:i+4], uint32(len(p.fields)))
	i += 4

	i += copy(b[i:], p.fields)

	copy(b[i:], tb)
	return b, nil
}
331884
func (log *Log) GetBinary(i int64) ([]byte, int64, error) {

	// Position in file
	_, err := log.f.Seek(i, 0)
	if err != nil {
		return nil, 0, err
	}

	/* Read until EOS of binary OGDL.

	   There should be a Header first.
	*/
	p := newBinParser(log.f)

	if !p.header() {
		return nil, 0, err
	}
	for {
		lev, _, _ /* typ, b*/ := p.line(false)
		if lev == 0 {
			break
		}
	}

	n := p.n

	// Read bytes
	b := make([]byte, n)
	_, err = log.f.ReadAt(b, i)

	return b, int64(n), err
}
376180
func (f *File) IsBinary() (bin bool, err error) {
	reader, err := f.Reader()
	if err != nil {
		return false, err
	}
	defer ioutil.CheckClose(reader, &err)

	return binary.IsBinary(reader)
}
595870
func (m *DaemonConfigurationSpec) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
994413
func (m *StatusResponseClusterNodesItems0PrimaryAddress) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
1277034
func (s Slice) GetBinaryLength() (ValueLength, error) {
	if !s.IsBinary() {
		return 0, InvalidTypeError{"Expecting type Binary"}
	}

	h := s.head()
	vpackAssert(h >= 0xc0 && h <= 0xc7)

	lengthSize := uint(h - 0xbf)
	length := readIntegerNonEmpty(s[1:], lengthSize)
	return ValueLength(length), nil
}
227222
func DecodeIfBinaryToBytes(in []byte) []byte {
	if binaryFmt(in) {
		var b bytes.Buffer
		Cbor2JsonManyObjects(bytes.NewReader(in), &b)
		return b.Bytes()
	}
	return in
}
1102839
func (m *LoadResponse) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
442580
func (m *EndpointNetworking) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
874740
func (m *StatusResponseClusterNodesItems0PrimaryAddressIPV4) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
1250454
func (o *GetLoginOKBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}
158620
func (bf *BitField) MarshalBinary() ([]byte, error) {
	ret := make([]byte, binary.MaxVarintLen32+len(bf.data))
	n := binary.PutUvarint(ret, uint64(bf.size))
	n += copy(ret[n:], bf.data)
	return ret[:n], nil
}
1190047
func (m *Status) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
418714
func (m *Swaggeroauth2TokenResponse) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}
1095535
func (pl *Payload) ReadBinary(r io.Reader) error {
	dec := gob.NewDecoder(r)
	return pl.DecodeBinary(dec)
}