mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 20:11:12 +00:00
Refactored the Java and C# code generators into one.
Also made the C# implementation support unsigned types, and made it more like the Java version. Bug: 17359988 Change-Id: If5305c08cd5c97f35426639516ce05e53bbec36c Tested: on Linux and Windows.
This commit is contained in:
@@ -74,14 +74,14 @@ namespace FlatBuffers
|
||||
return t;
|
||||
}
|
||||
|
||||
protected static bool __has_identifier(ByteBuffer bb, int offset, string ident)
|
||||
protected static bool __has_identifier(ByteBuffer bb, string ident)
|
||||
{
|
||||
if (ident.Length != FlatBufferConstants.FileIdentifierLength)
|
||||
throw new ArgumentException("FlatBuffers: file identifier must be length " + FlatBufferConstants.FileIdentifierLength, "ident");
|
||||
|
||||
for (var i = 0; i < FlatBufferConstants.FileIdentifierLength; i++)
|
||||
{
|
||||
if (ident[i] != (char)bb.Get(offset + sizeof(int) + i)) return false;
|
||||
if (ident[i] != (char)bb.Get(bb.position() + sizeof(int) + i)) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user