github.com/GeniusesGroup/libgo@v0.0.0-20220929090155-5ff932cb408e/srpc/frame-padding.go (about) 1 /* For license and copyright information please see LEGAL file in repository */ 2 3 package srpc 4 5 import "../syllab" 6 7 /* 8 type paddingFrame struct { 9 Length [2]byte // including the header fields 10 Padding []byte 11 } 12 */ 13 type paddingFrame []byte 14 15 func (f paddingFrame) Length() uint16 { return syllab.GetUInt16(f, 0) } 16 func (f paddingFrame) Payload() []byte { return f[2:f.Length()] } 17 func (f paddingFrame) NextFrame() []byte { return f[f.Length():] }