// Encode writes the serialized version of the target HopData into the passed
// io.Writer.
Encode writes the serialized version of the target HopData into the passed
io.Writer.
// Encode writes the serialized version of the target HopData into the passed // io . Writer .
func (hd *HopData) Encode(w io.Writer) error {
	if _, err := w.Write(hd.Realm[:]); err != nil {
		return err
	}
	if _, err := w.Write(hd.NextAddress[:]); err != nil {
		return err
	}
	if err := binary.Write(w, binary.BigEndian, hd.ForwardAmount); err != nil {
		return err
	}
	if err := binary.Write(w, binary.BigEndian, hd.OutgoingCltv); err != nil {
		return err
	}
	if _, err := w.Write(hd.ExtraBytes[:]); err != nil {
		return err
	}
	return nil
}
func ( hd * HopData ) Encode ( w io . Writer ) error { if _ , err := w . Write ( hd . Realm [ : ] ) ; err != nil { return err } if _ , err := w . Write ( hd . NextAddress [ : ] ) ; err != nil { return err } if err := binary . Write ( w , binary . BigEndian , hd . ForwardAmount ) ; err != nil { return err } if err := binary . Write ( w , binary . BigEndian , hd . OutgoingCltv ) ; err != nil { return err } if _ , err := w . Write ( hd . ExtraBytes [ : ] ) ; err != nil { return err } return nil }
Encode writes the serialized version of the target HopData into the passed
io.Writer.
Encode writes the serialized version of the target HopData into the passed io . Writer .