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:
Alex Wasserman
2017-07-13 10:33:32 -05:00
committed by Wouter van Oortmerssen
parent f20204180d
commit 625c989875
7 changed files with 308 additions and 173 deletions

View File

@@ -160,7 +160,7 @@ public final class Monster extends Table {
while (span != 0) {
int middle = span / 2;
int tableOffset = __indirect(vectorLocation + 4 * (start + middle), bb);
int comp = compareStrings(__offset(10, bb.array().length - tableOffset, bb), byteKey, bb);
int comp = compareStrings(__offset(10, bb.capacity() - tableOffset, bb), byteKey, bb);
if (comp > 0) {
span = middle;
} else if (comp < 0) {