Package io.grpc.alts.internal
Class BufUnwrapper
- java.lang.Object
-
- io.grpc.alts.internal.BufUnwrapper
-
- All Implemented Interfaces:
java.lang.AutoCloseable
final class BufUnwrapper extends java.lang.Object implements java.lang.AutoCloseable
UnwrapsByteBuf
s intoByteBuffer
s.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer[]
singleReadBuffer
private java.nio.ByteBuffer[]
singleWriteBuffer
-
Constructor Summary
Constructors Constructor Description BufUnwrapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private static java.nio.ByteBuffer[]
nioBuffers(io.netty.buffer.ByteBuf buf, java.nio.ByteBuffer[] singleBuffer)
Optimized accessor for obtaining the underlying NIO buffers for a NettyByteBuf
.(package private) java.nio.ByteBuffer[]
readableNioBuffers(io.netty.buffer.ByteBuf buf)
Called to get access to the underlying NIO buffers for aByteBuf
that will be used for reading.(package private) java.nio.ByteBuffer[]
writableNioBuffers(io.netty.buffer.ByteBuf buf)
Called to get access to the underlying NIO buffers for aByteBuf
that will be used for writing.
-
-
-
Method Detail
-
writableNioBuffers
java.nio.ByteBuffer[] writableNioBuffers(io.netty.buffer.ByteBuf buf)
Called to get access to the underlying NIO buffers for aByteBuf
that will be used for writing.
-
readableNioBuffers
java.nio.ByteBuffer[] readableNioBuffers(io.netty.buffer.ByteBuf buf)
Called to get access to the underlying NIO buffers for aByteBuf
that will be used for reading.
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
nioBuffers
private static java.nio.ByteBuffer[] nioBuffers(io.netty.buffer.ByteBuf buf, java.nio.ByteBuffer[] singleBuffer)
Optimized accessor for obtaining the underlying NIO buffers for a NettyByteBuf
. Based on code from Netty'sSslHandler
. This method returns NIO buffers that span the readable region of theByteBuf
.
-
-