mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-06 05:27:24 +00:00
Java: Added ByteBufferFactory interface and sizedInputStream method. (#4379)
The ByteBufferFactory interface gives the user an option to specify the method in which the internal ByteBuffer is allocated. This provides flexibility in the type of ByteBuffer that can be used. The sizedInputStream method is an alternative to sizedByteArray that does not make a copy of the data in memory.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
f20204180d
commit
625c989875
@@ -690,7 +690,7 @@ void GenStructBody(const StructDef &struct_def, std::string *code_ptr,
|
||||
std::string GenByteBufferLength(const char *bb_name) {
|
||||
std::string bb_len = bb_name;
|
||||
if (lang_.language == IDLOptions::kCSharp) bb_len += ".Length";
|
||||
else bb_len += ".array().length";
|
||||
else bb_len += ".capacity()";
|
||||
return bb_len;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user