public class GetReadableBuffer extends Object
This could be solved by BufferInputStream exposing Drainable.
Constructor and Description |
---|
GetReadableBuffer() |
Modifier and Type | Method and Description |
---|---|
static io.grpc.internal.ReadableBuffer |
getReadableBuffer(InputStream is)
Extracts the ReadableBuffer for the given input stream.
|
static void |
readIntoBuffer(InputStream stream,
ArrowBuf buf,
int size,
boolean fastPath)
Helper method to read a gRPC-provided InputStream into an ArrowBuf.
|
public static io.grpc.internal.ReadableBuffer getReadableBuffer(InputStream is)
is
- Must be an instance of io.grpc.internal.ReadableBuffers$BufferInputStream or
null will be returned.public static void readIntoBuffer(InputStream stream, ArrowBuf buf, int size, boolean fastPath) throws IOException
stream
- The stream to read from. Should be an instance of BUFFER_INPUT_STREAM
.buf
- The buffer to read into.size
- The number of bytes to read.fastPath
- Whether to enable the fast path (i.e. detect whether the stream is a BUFFER_INPUT_STREAM
).IOException
- if there is an error reading form the streamCopyright © 2023 The Apache Software Foundation. All rights reserved.