MCPcopy
hub / github.com/google/gopacket / SerializeTo

Method SerializeTo

base.go:68–75  ·  view source on GitHub ↗

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

(b SerializeBuffer, opts SerializeOptions)

Source from the content-addressed store, hash-verified

66// SerializationBuffer, implementing gopacket.SerializableLayer.
67// See the docs for gopacket.SerializableLayer for more info.
68func (p Payload) SerializeTo(b SerializeBuffer, opts SerializeOptions) error {
69 bytes, err := b.PrependBytes(len(p))
70 if err != nil {
71 return err
72 }
73 copy(bytes, p)
74 return nil
75}
76
77// decodePayload decodes data by returning it all in a Payload layer.
78func decodePayload(data []byte, p PacketBuilder) error {

Callers

nothing calls this directly

Calls 1

PrependBytesMethod · 0.65

Tested by

no test coverage detected