mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 03:00:02 +00:00
Support size-prefixed buffers and add tests for size-prefixed messages (#6232)
This commit is contained in:
@@ -39,6 +39,13 @@ func GetRootAsTableInNestedNS(buf []byte, offset flatbuffers.UOffsetT) *TableInN
|
||||
return x
|
||||
}
|
||||
|
||||
func GetSizePrefixedRootAsTableInNestedNS(buf []byte, offset flatbuffers.UOffsetT) *TableInNestedNS {
|
||||
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
|
||||
x := &TableInNestedNS{}
|
||||
x.Init(buf, n+offset+flatbuffers.SizeUint32)
|
||||
return x
|
||||
}
|
||||
|
||||
func (rcv *TableInNestedNS) Init(buf []byte, i flatbuffers.UOffsetT) {
|
||||
rcv._tab.Bytes = buf
|
||||
rcv._tab.Pos = i
|
||||
|
||||
Reference in New Issue
Block a user