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

Method SerializeTo

base.go:122–129  ·  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

120// SerializationBuffer, implementing gopacket.SerializableLayer.
121// See the docs for gopacket.SerializableLayer for more info.
122func (p *Fragment) SerializeTo(b SerializeBuffer, opts SerializeOptions) error {
123 bytes, err := b.PrependBytes(len(*p))
124 if err != nil {
125 return err
126 }
127 copy(bytes, *p)
128 return nil
129}
130
131// decodeFragment decodes data by returning it all in a Fragment layer.
132func decodeFragment(data []byte, p PacketBuilder) error {

Callers

nothing calls this directly

Calls 1

PrependBytesMethod · 0.65

Tested by

no test coverage detected