Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
d7d527d1
Commit
d7d527d1
authored
Dec 21, 2015
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/google/flatbuffers
parents
995ee86a
b974e95c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
ByteBuffer.cs
net/FlatBuffers/ByteBuffer.cs
+7
-0
FlatBufferBuilder.cs
net/FlatBuffers/FlatBufferBuilder.cs
+8
-11
readme.md
readme.md
+2
-2
No files found.
net/FlatBuffers/ByteBuffer.cs
View file @
d7d527d1
...
...
@@ -146,6 +146,13 @@ namespace FlatBuffers
_buffer
[
offset
]
=
value
;
}
public
void
PutByte
(
int
offset
,
byte
value
,
int
count
)
{
AssertOffsetAndLength
(
offset
,
sizeof
(
byte
)
*
count
);
for
(
var
i
=
0
;
i
<
count
;
++
i
)
_buffer
[
offset
+
i
]
=
value
;
}
// this method exists in order to conform with Java ByteBuffer standards
public
void
Put
(
int
offset
,
byte
value
)
{
...
...
net/FlatBuffers/FlatBufferBuilder.cs
View file @
d7d527d1
...
...
@@ -69,10 +69,7 @@ namespace FlatBuffers
public
void
Pad
(
int
size
)
{
for
(
var
i
=
0
;
i
<
size
;
i
++)
{
_bb
.
PutByte
(--
_space
,
0
);
}
_bb
.
PutByte
(
_space
-=
size
,
0
,
size
);
}
// Doubles the size of the ByteBuffer, and copies the old data towards
...
...
@@ -116,7 +113,8 @@ namespace FlatBuffers
_space
+=
(
int
)
_bb
.
Length
-
oldBufSize
;
}
Pad
(
alignSize
);
if
(
alignSize
>
0
)
Pad
(
alignSize
);
}
public
void
PutBool
(
bool
x
)
...
...
@@ -276,12 +274,11 @@ namespace FlatBuffers
public
StringOffset
CreateString
(
string
s
)
{
NotNested
();
byte
[]
utf8
=
Encoding
.
UTF8
.
GetBytes
(
s
);
AddByte
((
byte
)
0
);
StartVector
(
1
,
utf8
.
Length
,
1
);
Buffer
.
BlockCopy
(
utf8
,
0
,
_bb
.
Data
,
_space
-=
utf8
.
Length
,
utf8
.
Length
);
NotNested
();
AddByte
(
0
);
var
utf8StringLen
=
Encoding
.
UTF8
.
GetByteCount
(
s
);
StartVector
(
1
,
utf8StringLen
,
1
);
Encoding
.
UTF8
.
GetBytes
(
s
,
0
,
s
.
Length
,
_bb
.
Data
,
_space
-=
utf8StringLen
);
return
new
StringOffset
(
EndVector
().
Value
);
}
...
...
readme.md
View file @
d7d527d1
...
...
@@ -18,8 +18,7 @@ Windows, OS X, Linux), see `docs/html/index.html`
Discuss FlatBuffers with other developers and users on the
[
FlatBuffers Google Group
][]
. File issues on the
[
FlatBuffers Issues Tracker
][]
or post your questions to
[
stackoverflow.com
][]
with a mention of
**flatbuffers**
.
or post your questions to
[
stackoverflow.com
][]
using the
[
`flatbuffers` tag
][]
.
For applications on Google Play that integrate this tool, usage is tracked.
This tracking is done automatically using the embedded version string
...
...
@@ -34,3 +33,4 @@ you would leave it in.
[
FlatBuffers Issues Tracker
]:
http://github.com/google/flatbuffers/issues
[
stackoverflow.com
]:
http://www.stackoverflow.com
[
landing page
]:
http://google.github.io/flatbuffers
[
`flatbuffers` tag
]:
https://stackoverflow.com/questions/tagged/flatbuffers
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment