forked from BigfootDev/flatbuffers
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.google.flatbuffers</groupId>
|
||||
<artifactId>flatbuffers-parent</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<version>2.0.2</version>
|
||||
</parent>
|
||||
<artifactId>flatbuffers-java-grpc</artifactId>
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>com.google.flatbuffers</groupId>
|
||||
<artifactId>flatbuffers-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.1</version>
|
||||
<version>2.0.2</version>
|
||||
<name>flatbuffers-parent</name>
|
||||
<description>parent pom for flatbuffers java artifacts</description>
|
||||
<properties>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<parent>
|
||||
<groupId>com.google.flatbuffers</groupId>
|
||||
<artifactId>flatbuffers-parent</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<version>2.0.2</version>
|
||||
</parent>
|
||||
<artifactId>grpc-test</artifactId>
|
||||
<description>Example/Test project demonstrating usage of flatbuffers with GRPC-Java instead of protobufs
|
||||
</description>
|
||||
<properties>
|
||||
<gRPC.version>2.0.1</gRPC.version>
|
||||
<gRPC.version>2.0.2</gRPC.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ByteBufferReadWriteBuf implements ReadWriteBuf {
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
buffer.clear();
|
||||
((Buffer) buffer).clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -92,7 +92,7 @@ public class FlatBufferBuilder {
|
||||
this.bb_factory = bb_factory;
|
||||
if (existing_bb != null) {
|
||||
bb = existing_bb;
|
||||
bb.clear();
|
||||
((Buffer) bb).clear();
|
||||
bb.order(ByteOrder.LITTLE_ENDIAN);
|
||||
} else {
|
||||
bb = bb_factory.newByteBuffer(initial_size);
|
||||
@@ -154,7 +154,7 @@ public class FlatBufferBuilder {
|
||||
public FlatBufferBuilder init(ByteBuffer existing_bb, ByteBufferFactory bb_factory){
|
||||
this.bb_factory = bb_factory;
|
||||
bb = existing_bb;
|
||||
bb.clear();
|
||||
((Buffer) bb).clear();
|
||||
bb.order(ByteOrder.LITTLE_ENDIAN);
|
||||
minalign = 1;
|
||||
space = bb.capacity();
|
||||
@@ -235,7 +235,7 @@ public class FlatBufferBuilder {
|
||||
*/
|
||||
public void clear(){
|
||||
space = bb.capacity();
|
||||
bb.clear();
|
||||
((Buffer) bb).clear();
|
||||
minalign = 1;
|
||||
while(vtable_in_use > 0) vtable[--vtable_in_use] = 0;
|
||||
vtable_in_use = 0;
|
||||
@@ -275,7 +275,7 @@ public class FlatBufferBuilder {
|
||||
|
||||
((Buffer) bb).position(0);
|
||||
ByteBuffer nbb = bb_factory.newByteBuffer(new_buf_size);
|
||||
new_buf_size = nbb.clear().capacity(); // Ensure the returned buffer is treated as empty
|
||||
new_buf_size = ((Buffer) nbb).clear().capacity(); // Ensure the returned buffer is treated as empty
|
||||
((Buffer) nbb).position(new_buf_size - old_buf_size);
|
||||
nbb.put(bb);
|
||||
return nbb;
|
||||
|
||||
@@ -56,7 +56,7 @@ public class Utf8Old extends Utf8 {
|
||||
if (cache.lastOutput == null || cache.lastOutput.capacity() < estimated) {
|
||||
cache.lastOutput = ByteBuffer.allocate(Math.max(128, estimated));
|
||||
}
|
||||
cache.lastOutput.clear();
|
||||
((Buffer) cache.lastOutput).clear();
|
||||
cache.lastInput = in;
|
||||
CharBuffer wrap = (in instanceof CharBuffer) ?
|
||||
(CharBuffer) in : CharBuffer.wrap(in);
|
||||
@@ -68,7 +68,7 @@ public class Utf8Old extends Utf8 {
|
||||
throw new IllegalArgumentException("bad character encoding", e);
|
||||
}
|
||||
}
|
||||
cache.lastOutput.flip();
|
||||
((Buffer) cache.lastOutput).flip();
|
||||
return cache.lastOutput.remaining();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user