From 9fa3e2f3876096f6409ccdf849378cd57d52dfd2 Mon Sep 17 00:00:00 2001 From: "Jean-Baptiste \"Jiboo\" Lepesme" Date: Mon, 11 May 2015 19:17:01 +0200 Subject: [PATCH] Added a default costructor for Java's FlatBufferBuilder. Default's size of 1024b like in cpp. Fixes #190. --- java/com/google/flatbuffers/FlatBufferBuilder.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/java/com/google/flatbuffers/FlatBufferBuilder.java b/java/com/google/flatbuffers/FlatBufferBuilder.java index 5b1425a2d..ac6e67226 100644 --- a/java/com/google/flatbuffers/FlatBufferBuilder.java +++ b/java/com/google/flatbuffers/FlatBufferBuilder.java @@ -52,6 +52,13 @@ public class FlatBufferBuilder { bb = newByteBuffer(initial_size); } + /** + * Start with a buffer of 1KiB, then grow as required. + */ + public FlatBufferBuilder() { + this(1024); + } + /** * Alternative constructor allowing reuse of {@link ByteBuffer}s. The builder * can still grow the buffer as necessary. User classes should make sure