Skip to content

Commit 31659f0

Browse files
committed
MINOR: Fix GetReadableBuffer compilation with gRPC 1.79.0
Replace ReadableBuffer.readBytes(ByteBuffer) with readBytes(byte[], int, int) as the ByteBuffer overload was removed in gRPC 1.79.0.
1 parent f854eb3 commit 31659f0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/GetReadableBuffer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ public static void readIntoBuffer(
8787
final InputStream stream, final ArrowBuf buf, final int size, final boolean fastPath)
8888
throws IOException {
8989
ReadableBuffer readableBuffer = fastPath ? getReadableBuffer(stream) : null;
90+
byte[] heapBytes = new byte[size];
9091
if (readableBuffer != null) {
91-
readableBuffer.readBytes(buf.nioBuffer(0, size));
92+
readableBuffer.readBytes(heapBytes, 0, size);
9293
} else {
93-
byte[] heapBytes = new byte[size];
9494
ByteStreams.readFully(stream, heapBytes);
95-
buf.writeBytes(heapBytes);
9695
}
96+
buf.writeBytes(heapBytes);
9797
buf.writerIndex(size);
9898
}
9999
}

0 commit comments

Comments
 (0)