From af21b9064d69bd254c44ce8af9cfdf622551d754 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 24 Oct 2016 10:29:09 -0700 Subject: [PATCH] Change docs to not encourage use of 1 byte buffers. Change-Id: Ib0b1692044f35e374a0f7c0359c94319f4a25619 --- docs/source/Tutorial.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/source/Tutorial.md b/docs/source/Tutorial.md index 420524fb578..7d9c6d919df 100644 --- a/docs/source/Tutorial.md +++ b/docs/source/Tutorial.md @@ -399,55 +399,56 @@ The first step is to import/include the library, generated files, etc. Now we are ready to start building some buffers. In order to start, we need to create an instance of the `FlatBufferBuilder`, which will contain the buffer -as it grows: +as it grows. You can pass an initial size of the buffer (here 1024 bytes), +which will grow automatically if needed:
~~~{.cpp} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. - flatbuffers::FlatBufferBuilder builder; + flatbuffers::FlatBufferBuilder builder(1024); ~~~
~~~{.java} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. - FlatBufferBuilder builder = new FlatBufferBuilder(0); + FlatBufferBuilder builder = new FlatBufferBuilder(1024); ~~~
~~~{.cs} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. - var builder = new FlatBufferBuilder(1); + var builder = new FlatBufferBuilder(1024); ~~~
~~~{.go} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. - builder := flatbuffers.NewBuilder(0) + builder := flatbuffers.NewBuilder(1024) ~~~
~~~{.py} # Create a `FlatBufferBuilder`, which will be used to create our # monsters' FlatBuffers. - builder = flatbuffers.Builder(0) + builder = flatbuffers.Builder(1024) ~~~
~~~{.js} // Create a `flatbuffer.Builder`, which will be used to create our // monsters' FlatBuffers. - var builder = new flatbuffers.Builder(1); + var builder = new flatbuffers.Builder(1024); ~~~
~~~{.php} // Create a `FlatBufferBuilder`, which will be used to create our // monsters' FlatBuffers. - $builder = new Google\FlatBuffers\FlatbufferBuilder(0); + $builder = new Google\FlatBuffers\FlatbufferBuilder(1024); ~~~