Home
last modified time | relevance | path

Searched refs:ByteBuf (Results 1 – 25 of 45) sorted by relevance

12

/external/grpc-grpc-java/benchmarks/src/jmh/java/io/grpc/benchmarks/netty/
DAbstractBenchmark.java37 import io.netty.buffer.ByteBuf;
174 protected ByteBuf request;
175 protected ByteBuf response;
176 protected MethodDescriptor<ByteBuf, ByteBuf> unaryMethod;
177 private MethodDescriptor<ByteBuf, ByteBuf> pingPongMethod;
178 private MethodDescriptor<ByteBuf, ByteBuf> flowControlledStreaming;
243 unaryMethod = MethodDescriptor.<ByteBuf, ByteBuf>newBuilder() in setup()
265 .addMethod(unaryMethod, new ServerCallHandler<ByteBuf, ByteBuf>() { in setup()
267 public ServerCall.Listener<ByteBuf> startCall( in setup()
268 final ServerCall<ByteBuf, ByteBuf> call, in setup()
[all …]
/external/grpc-grpc-java/alts/src/main/java/io/grpc/alts/internal/
DAltsTsiFrameProtector.java24 import io.netty.buffer.ByteBuf;
78 List<ByteBuf> unprotectedBufs, Consumer<ByteBuf> ctxWrite, ByteBufAllocator alloc) in protectFlush()
84 public void unprotect(ByteBuf in, List<Object> out, ByteBufAllocator alloc) in unprotect()
115 List<ByteBuf> unprotectedBufs, Consumer<ByteBuf> ctxWrite, ByteBufAllocator alloc) in protectFlush()
118 ByteBuf protectedBuf; in protectFlush()
122 for (ByteBuf buf : unprotectedBufs) { in protectFlush()
132 private ByteBuf handleUnprotected(List<ByteBuf> unprotectedBufs, ByteBufAllocator alloc) in handleUnprotected()
135 for (ByteBuf buf : unprotectedBufs) { in handleUnprotected()
150 ByteBuf protectedBuf = alloc.directBuffer(Ints.checkedCast(protectedBytes)); in handleUnprotected()
161 ByteBuf frameOut = writeSlice(protectedBuf, unprotectedBytesLeft + suffixBytes); in handleUnprotected()
[all …]
DChannelCrypterNetty.java19 import io.netty.buffer.ByteBuf;
42 void encrypt(ByteBuf out, List<ByteBuf> plain) throws GeneralSecurityException; in encrypt()
56 void decrypt(ByteBuf out, ByteBuf tag, List<ByteBuf> ciphertext) throws GeneralSecurityException; in decrypt()
69 void decrypt(ByteBuf out, ByteBuf ciphertextAndTag) throws GeneralSecurityException; in decrypt()
DAltsChannelCrypter.java23 import io.netty.buffer.ByteBuf;
59 public void encrypt(ByteBuf outBuf, List<ByteBuf> plainBufs) throws GeneralSecurityException { in encrypt()
62 ByteBuf plainBuf = outBuf.slice(outBuf.writerIndex(), outBuf.writableBytes()); in encrypt()
64 for (ByteBuf inBuf : plainBufs) { in encrypt()
82 public void decrypt(ByteBuf out, ByteBuf tag, List<ByteBuf> ciphertextBufs) in decrypt()
85 ByteBuf cipherTextAndTag = out.slice(out.writerIndex(), out.writableBytes()); in decrypt()
88 for (ByteBuf inBuf : ciphertextBufs) { in decrypt()
98 public void decrypt(ByteBuf out, ByteBuf ciphertextAndTag) throws GeneralSecurityException { in decrypt()
DTsiFrameHandler.java25 import io.netty.buffer.ByteBuf;
76 protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { in decode()
85 ByteBuf msg = (ByteBuf) message; in write()
151 List<ByteBuf> bufs = new ArrayList<>(pendingUnprotectedWrites.size()); in flush()
161 ByteBuf in = (ByteBuf) pendingUnprotectedWrites.current(); in flush()
169 new Consumer<ByteBuf>() { in flush()
171 public void accept(ByteBuf b) { in flush()
DTsiFrameProtector.java19 import io.netty.buffer.ByteBuf;
40 List<ByteBuf> unprotectedBufs, Consumer<ByteBuf> ctxWrite, ByteBufAllocator alloc) in protectFlush()
50 void unprotect(ByteBuf in, List<Object> out, ByteBufAllocator alloc) in unprotect()
DBufUnwrapper.java19 import io.netty.buffer.ByteBuf;
33 ByteBuffer[] writableNioBuffers(ByteBuf buf) { in writableNioBuffers()
54 ByteBuffer[] readableNioBuffers(ByteBuf buf) { in readableNioBuffers()
69 private static ByteBuffer[] nioBuffers(ByteBuf buf, ByteBuffer[] singleBuffer) { in nioBuffers()
DTsiHandshakeHandler.java22 import io.netty.buffer.ByteBuf;
46 private ByteBuf buffer;
136 protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) in decodeLast()
143 protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { in decode()
201 private ByteBuf getOrCreateBuffer(ByteBufAllocator alloc) { in getOrCreateBuffer()
/external/grpc-grpc-java/alts/src/test/java/io/grpc/alts/internal/
DAltsTsiFrameProtectorTest.java27 import io.netty.buffer.ByteBuf;
52 public ByteBuf register(ByteBuf buf) {
82 ByteBuf in = getDirectBuffer(AltsTsiFrameProtector.getHeaderBytes(), ref); in parserHeader_frameLengthNegativeFails()
102 ByteBuf in = in parserHeader_frameTooSmall()
124 ByteBuf in = in parserHeader_frameTooLarge()
149 ByteBuf in = in parserHeader_frameTypeInvalid()
171 ByteBuf in = in parserHeader_frameZeroOk()
190 ByteBuf emptyBuf = getDirectBuffer(0, ref); in parserHeader_EmptyUnprotectNoRetain()
205 ByteBuf in = in parserHeader_frameMaxOk()
226 ByteBuf in = in parserHeader_frameOkFragment()
[all …]
DByteBufTestUtils.java20 import io.netty.buffer.ByteBuf;
29 ByteBuf register(ByteBuf buf); in register()
36 public static ByteBuf getDirectBuffer(int len, RegisterRef ref) { in getDirectBuffer()
41 public static ByteBuf getRandom(int len, RegisterRef ref) { in getRandom()
42 ByteBuf buf = getDirectBuffer(len, ref); in getRandom()
50 public static List<ByteBuf> fragmentByteBuf(ByteBuf in, int num, RegisterRef ref) { in fragmentByteBuf()
51 ByteBuf buf = in.slice(); in fragmentByteBuf()
53 List<ByteBuf> fragmentedBufs = new ArrayList<>(num); in fragmentByteBuf()
57 ByteBuf tmpBuf = getDirectBuffer(readBytes, ref); in fragmentByteBuf()
65 static ByteBuf writeSlice(ByteBuf in, int len) { in writeSlice()
[all …]
DFakeChannelCrypter.java21 import io.netty.buffer.ByteBuf;
38 public void encrypt(ByteBuf out, List<ByteBuf> plain) throws GeneralSecurityException { in encrypt()
40 for (ByteBuf buf : plain) { in encrypt()
49 public void decrypt(ByteBuf out, ByteBuf tag, List<ByteBuf> ciphertext) in decrypt()
52 for (ByteBuf buf : ciphertext) { in decrypt()
63 public void decrypt(ByteBuf out, ByteBuf ciphertextAndTag) throws GeneralSecurityException { in decrypt()
65 ByteBuf ciphertext = ciphertextAndTag.readSlice(ciphertextAndTag.readableBytes() - TAG_BYTES); in decrypt()
DTsiTest.java26 import io.netty.buffer.ByteBuf;
126 ByteBuf plaintextBuffer = Unpooled.wrappedBuffer(message.getBytes(UTF_8)); in sendMessage()
127 final List<ByteBuf> protectOut = new ArrayList<>(); in sendMessage()
132 new Consumer<ByteBuf>() { in sendMessage()
134 public void accept(ByteBuf buf) { in sendMessage()
141 ByteBuf protect = ref.register(protectOut.get(0)); in sendMessage()
143 ByteBuf buf = protect; in sendMessage()
150 ByteBuf plaintextRecvd = getDirectBuffer(message.getBytes(UTF_8).length, ref); in sendMessage()
152 ByteBuf unprotectBuf = ref.register((ByteBuf) unprotect); in sendMessage()
260 ByteBuf plaintextBuffer = Unpooled.wrappedBuffer(message.getBytes(UTF_8)); in corruptedCounterTest()
[all …]
DNettyTsiHandshakerTest.java25 import io.netty.buffer.ByteBuf;
69 ByteBuf clientData = ref(alloc.buffer(1)); in processPeerHandshakeShouldAcceptPartialFrames()
156 Function<ByteBuf, ByteBuf> ref) in doHandshake() argument
164 ByteBuf clientData = ref.apply(alloc.buffer()); in doHandshake()
170 ByteBuf serverData = ref.apply(alloc.buffer()); in doHandshake()
185 new Function<ByteBuf, ByteBuf>() { in doHandshake()
187 public ByteBuf apply(ByteBuf buf) { in doHandshake()
193 private ByteBuf ref(ByteBuf buf) { in ref()
DChannelCrypterNettyTestBase.java26 import io.netty.buffer.ByteBuf;
46 public ByteBuf register(ByteBuf buf) {
55 List<ByteBuf> plain;
56 ByteBuf out;
60 List<ByteBuf> ciphertext;
61 ByteBuf out;
62 ByteBuf tag;
68 ByteBuf plain = getDirectBuffer(messageBytes.length, ref); in createFrameEncrypt()
78 ByteBuf out = frameEncrypt.out; in frameDecryptOfEncrypt()
101 ByteBuf plain = getRandom(17 * 1024, ref); in encryptDecryptLarge()
[all …]
DAltsProtocolNegotiatorTest.java35 import io.netty.buffer.ByteBuf;
181 ByteBuf in = Unpooled.copiedBuffer(message, ix, 1, UTF_8); in protectShouldRoundtrip()
204 ByteBuf protectedData = channel.<ByteBuf>readOutbound(); in protectShouldRoundtrip()
209 List<ByteBuf> unprotected = new ArrayList<>(); in protectShouldRoundtrip()
218 ByteBuf unprotectedData = unprotectedAll.slice(settingsFrameLength, message.length()); in protectShouldRoundtrip()
222 final AtomicReference<ByteBuf> newlyProtectedData = new AtomicReference<>(); in protectShouldRoundtrip()
225 new Consumer<ByteBuf>() { in protectShouldRoundtrip()
227 public void accept(ByteBuf buf) { in protectShouldRoundtrip()
236 assertEquals(message, channel.<ByteBuf>readInbound().toString(UTF_8)); in protectShouldRoundtrip()
247 ByteBuf unprotectedData = Unpooled.wrappedBuffer(unprotectedBytes); in unprotectLargeIncomingFrame()
[all …]
DBufUnwrapperTest.java22 import io.netty.buffer.ByteBuf;
39 ByteBuf buf = alloc.buffer(); in closeEmptiesBuffers()
59 ByteBuf buf = alloc.buffer(1).writeByte('a'); in readableNioBuffers_worksWithNormal()
86 ByteBuf buf = alloc.buffer(1); in writableNioBuffers_indexesPreserved()
106 ByteBuf buf = alloc.buffer(1); in writableNioBuffers_worksWithNormal()
/external/grpc-grpc-java/benchmarks/src/main/java/io/grpc/benchmarks/driver/
DLoadServer.java40 import io.netty.buffer.ByteBuf;
58 private static final Marshaller<ByteBuf> marshaller = new ByteBufOutputMarshaller();
62 static final MethodDescriptor<ByteBuf, ByteBuf> GENERIC_UNARY_METHOD =
69 static final MethodDescriptor<ByteBuf, ByteBuf> GENERIC_STREAMING_PING_PONG_METHOD =
79 private ByteBuf genericResponse;
197 private class GenericServiceCallHandler implements ServerCallHandler<ByteBuf, ByteBuf> {
200 public ServerCall.Listener<ByteBuf> startCall( in startCall()
201 final ServerCall<ByteBuf, ByteBuf> call, Metadata headers) { in startCall() argument
204 return new ServerCall.Listener<ByteBuf>() { in startCall()
206 public void onMessage(ByteBuf message) { in startCall()
/external/grpc-grpc-java/netty/src/test/java/io/grpc/netty/
DNettyServerHandlerTest.java70 import io.netty.buffer.ByteBuf;
199 ByteBuf serializedSettings = serializeSettings(new Http2Settings()); in manualSetUp()
258 ByteBuf frame = grpcDataFrame(STREAM_ID, endStream, contentAsArray()); in inboundDataShouldForwardToStreamListener()
419 ByteBuf headersFrame = headersFrame(STREAM_ID, headers); in headersWithInvalidContentTypeShouldFail()
438 ByteBuf headersFrame = headersFrame(STREAM_ID, headers); in headersWithInvalidMethodShouldFail()
456 ByteBuf headersFrame = headersFrame(STREAM_ID, headers); in headersWithMissingPathShouldFail()
475 ByteBuf headersFrame = headersFrame(STREAM_ID, headers); in headersWithInvalidPathShouldFail()
495 ByteBuf headersFrame = headersFrame(STREAM_ID, headers); in headersSupportExtensionContentType()
509 ByteBuf headersFrame = headersFrame(STREAM_ID, new DefaultHttp2Headers()); in keepAliveManagerOnDataReceived_headersRead()
615 any(ByteBuf.class), any(ChannelPromise.class)); in keepAliveEnforcer_enforcesPings()
[all …]
DNettyHandlerTestBase.java38 import io.netty.buffer.ByteBuf;
83 private ByteBuf content;
226 protected final ByteBuf content() { in content()
246 protected ByteBuf grpcDataFrame(int streamId, boolean endStream, byte[] content) { in grpcDataFrame()
247 final ByteBuf compressionFrame = Unpooled.buffer(content.length); in grpcDataFrame()
254 ByteBuf bytebuf = ((NettyWritableBuffer) frame).bytebuf(); in grpcDataFrame()
269 protected final ByteBuf dataFrame(int streamId, boolean endStream, ByteBuf content) { in dataFrame()
278 protected final ByteBuf pingFrame(boolean ack, long payload) { in pingFrame()
284 protected final ByteBuf headersFrame(int streamId, Http2Headers headers) { in headersFrame()
290 protected final ByteBuf goAwayFrame(int lastStreamId) { in goAwayFrame()
[all …]
DNettyTestUtil.java22 import io.netty.buffer.ByteBuf;
39 static ByteBuf messageFrame(String message) throws Exception { in messageFrame()
49 static ByteBuf compressionFrame(byte[] data) { in compressionFrame()
50 ByteBuf buf = Unpooled.buffer(); in compressionFrame()
/external/grpc-grpc-java/netty/src/main/java/io/grpc/netty/
DNettyWritableBuffer.java20 import io.netty.buffer.ByteBuf;
27 private final ByteBuf bytebuf;
29 NettyWritableBuffer(ByteBuf bytebuf) { in NettyWritableBuffer()
58 ByteBuf bytebuf() { in bytebuf()
DNettyReadableBuffer.java21 import io.netty.buffer.ByteBuf;
32 private final ByteBuf buffer;
35 NettyReadableBuffer(ByteBuf buffer) { in NettyReadableBuffer()
39 ByteBuf buffer() { in buffer()
/external/grpc-grpc-java/benchmarks/src/main/java/io/grpc/benchmarks/
DByteBufOutputMarshaller.java20 import io.netty.buffer.ByteBuf;
29 public class ByteBufOutputMarshaller implements MethodDescriptor.Marshaller<ByteBuf> {
35 public InputStream stream(ByteBuf value) { in stream()
40 public ByteBuf parse(InputStream stream) { in parse()
DByteBufInputStream.java21 import io.netty.buffer.ByteBuf;
33 private ByteBuf buf;
35 ByteBufInputStream(ByteBuf buf) { in ByteBufInputStream()
/external/conscrypt/benchmark-jmh/src/jmh/java/org/conscrypt/
DNettyBufferAllocator.java18 import io.netty.buffer.ByteBuf;
42 private final ByteBuf nettyBuffer;
45 private ByteBufAdapter(ByteBuf nettyBuffer) { in ByteBufAdapter()

12