lin
2025-03-21 36aaa54056c4f4e150f6ee0636610d9a68470a08
1
2
3
4
5
6
7
8
9
10
11
12
13
package flatbuffers
 
// FlatBuffer is the interface that represents a flatbuffer.
type FlatBuffer interface {
   Table() Table
   Init(buf []byte, i UOffsetT)
}
 
// GetRootAs is a generic helper to initialize a FlatBuffer with the provided buffer bytes and its data offset.
func GetRootAs(buf []byte, offset UOffsetT, fb FlatBuffer) {
   n := GetUOffsetT(buf[offset:])
   fb.Init(buf, n+offset)
}