diff options
author | pjulien <pjulien@gmail.com> | 2016-04-25 22:07:57 -0400 |
---|---|---|
committer | pjulien <pjulien@gmail.com> | 2016-04-25 22:07:57 -0400 |
commit | 599f5e3915b8a745d6a198595065b44c5888dfc8 (patch) | |
tree | 4ef98ca0645b96b20d11a3921437399a06a224d5 /java | |
parent | ba7204a7b7e04052e9bf32319efee0b29c7002e2 (diff) | |
download | flatbuffers-599f5e3915b8a745d6a198595065b44c5888dfc8.tar.gz flatbuffers-599f5e3915b8a745d6a198595065b44c5888dfc8.tar.bz2 flatbuffers-599f5e3915b8a745d6a198595065b44c5888dfc8.zip |
Can now use ``CharSequence`` of ``String``. Works with
1. [AsciiString]
(http://netty.io/4.1/api/io/netty/util/AsciiString.html)
2. [CharBuffer]
(https://docs.oracle.com/javase/8/docs/api/java/nio/CharBuffer.html)
3. [StringBuilder]
(https://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html)
Diffstat (limited to 'java')
-rw-r--r--[-rwxr-xr-x] | java/com/google/flatbuffers/FlatBufferBuilder.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/java/com/google/flatbuffers/FlatBufferBuilder.java b/java/com/google/flatbuffers/FlatBufferBuilder.java index 480bb9d3..deaece8c 100755..100644 --- a/java/com/google/flatbuffers/FlatBufferBuilder.java +++ b/java/com/google/flatbuffers/FlatBufferBuilder.java @@ -373,7 +373,7 @@ public class FlatBufferBuilder { * @param s The string to encode. * @return The offset in the buffer where the encoded string starts. */ - public int createString(String s) { + public int createString(CharSequence s) { int length = s.length(); int estimatedDstCapacity = (int) (length * encoder.maxBytesPerChar()); if (dst == null || dst.capacity() < estimatedDstCapacity) { |