namespace flatbuffers.generated;
table MyTable {
myString:string;
}
root_type MyTable;
The 4 test cases illustrate:
- decoding the binary byte[] as directly retrieved from FlatBufferBuilder and then re-wrapped in a ByteBuffer works fine of course
- decoding the serialised form (<length><flat buffer byte[]> from a directly allocated ByteBuffer works
- decoding the serialised form (<length><flat buffer byte[]> from a heap allocated ByteBuffer fails
- decoding the serialised form (<length><flat buffer byte[]> from a byte[] wrapped ByteBuffer fails
If the Table#_string method is changed to always take the path as per no support for hasArray, then all work fine. This suggests that it's something to do with the endian-ness of the buffer, maybe at the point that the string's length of obtained, but I am unable to determine what exactly as the buffer properties look ok when stepping thru' the code with the debugger.
Any suggestions as to what I'm doing wrong or the cause would be most appreciated
--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.