Home
last modified time | relevance | path

Searched refs:readableBytes (Results 1 – 25 of 43) sorted by relevance

12

/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/
DCompositeReadableBufferTest.java57 assertEquals(EXPECTED_VALUE.length(), composite.readableBytes()); in singleBufferShouldSucceed()
59 assertEquals(0, composite.readableBytes()); in singleBufferShouldSucceed()
68 assertEquals(0, composite.readableBytes()); in readUnsignedByteShouldSucceed()
78 assertEquals(0, composite.readableBytes()); in readUnsignedByteShouldSkipZeroLengthBuffer()
86 assertEquals(remaining, composite.readableBytes()); in skipBytesShouldSucceed()
90 assertEquals(remaining, composite.readableBytes()); in skipBytesShouldSucceed()
93 assertEquals(0, composite.readableBytes()); in skipBytesShouldSucceed()
98 byte[] bytes = new byte[composite.readableBytes()]; in readByteArrayShouldSucceed()
103 assertEquals(EXPECTED_VALUE.length() - writeIndex, composite.readableBytes()); in readByteArrayShouldSucceed()
107 assertEquals(EXPECTED_VALUE.length() - writeIndex, composite.readableBytes()); in readByteArrayShouldSucceed()
[all …]
DReadableBufferTestBase.java42 assertEquals(msg.length() - ix, buffer.readableBytes()); in bufferShouldReadAllBytes()
45 assertEquals(0, buffer.readableBytes()); in bufferShouldReadAllBytes()
54 assertEquals(0, buffer.readableBytes()); in readToArrayShouldSucceed()
63 assertEquals(msg.length() - 2, buffer.readableBytes()); in partialReadToArrayShouldSucceed()
72 assertEquals(0, buffer.readableBytes()); in readToStreamShouldSucceed()
81 assertEquals(msg.length() - 2, buffer.readableBytes()); in partialReadToStreamShouldSucceed()
93 assertEquals(0, buffer.readableBytes()); in readToByteBufferShouldSucceed()
105 assertEquals(msg.length() - 2, buffer.readableBytes()); in partialReadToByteBufferShouldSucceed()
112 assertEquals(2, newBuffer.readableBytes()); in partialReadToReadableBufferShouldSucceed()
113 assertEquals(msg.length() - 2, buffer.readableBytes()); in partialReadToReadableBufferShouldSucceed()
DMessageFramerTest.java234 assertEquals(5, frameCaptor.getAllValues().get(0).readableBytes()); in largerFrameSizeUnknownLength()
240 assertEquals(500, frameCaptor.getAllValues().get(1).readableBytes()); in largerFrameSizeUnknownLength()
241 assertEquals(500, frameCaptor.getAllValues().get(2).readableBytes()); in largerFrameSizeUnknownLength()
422 public int readableBytes() {
443 return readableBytes() == other.readableBytes()
444 && Arrays.equals(Arrays.copyOf(data, readableBytes()),
445 Arrays.copyOf(other.data, readableBytes()));
450 return Arrays.hashCode(data) + writableBytes() + readableBytes();
DWritableBufferTestBase.java69 assertEquals(5, buffer().readableBytes()); in testWritableAndReadableBytes()
81 assertEquals(5, buffer().readableBytes()); in testWriteSrcIndex()
99 assertEquals(10 * (i + 1), buffer().readableBytes()); in testMultipleWrites()
DForwardingReadableBufferTest.java62 public void readableBytes() { in readableBytes() method in ForwardingReadableBufferTest
63 when(delegate.readableBytes()).thenReturn(1); in readableBytes()
65 assertEquals(1, buffer.readableBytes()); in readableBytes()
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/
DCompositeReadableBuffer.java35 private int readableBytes; field in CompositeReadableBuffer
47 readableBytes += buffer.readableBytes(); in addBuffer()
56 readableBytes += compositeBuffer.readableBytes; in addBuffer()
57 compositeBuffer.readableBytes = 0; in addBuffer()
62 public int readableBytes() { in readableBytes() method in CompositeReadableBuffer
63 return readableBytes; in readableBytes()
139 readableBytes -= length; in readBytes()
144 if (buffer.readableBytes() > length) { in readBytes()
149 length -= buffer.readableBytes(); in readBytes()
175 int lengthToCopy = Math.min(length, buffer.readableBytes()); in execute()
[all …]
DGzipInflatingBuffer.java112 private int readableBytes() { in readableBytes() method in GzipInflatingBuffer.GzipMetadataReader
113 return (inflaterInputEnd - inflaterInputStart) + gzippedData.readableBytes(); in readableBytes()
118 while (readableBytes() > 0) { in readBytesUntilZero()
202 return gzipMetadataReader.readableBytes() != 0 || state != State.HEADER; in hasPartialData()
313 || (state == State.HEADER && gzipMetadataReader.readableBytes() < GZIP_HEADER_MIN_SIZE); in inflateBytes()
319 if (gzipMetadataReader.readableBytes() < GZIP_HEADER_MIN_SIZE) { in processHeader()
339 if (gzipMetadataReader.readableBytes() < UNSIGNED_SHORT_SIZE) { in processHeaderExtraLen()
348 if (gzipMetadataReader.readableBytes() < headerExtraToRead) { in processHeaderExtra()
385 if (gzipMetadataReader.readableBytes() < UNSIGNED_SHORT_SIZE) { in processHeaderCrc()
444 int bytesToAdd = Math.min(gzippedData.readableBytes(), INFLATE_BUFFER_SIZE); in fill()
[all …]
DReadableBuffers.java74 int length = buffer.readableBytes(); in readArray()
146 public int readableBytes() { in readableBytes() method in ReadableBuffers.ByteArrayWrapper
219 public int readableBytes() { in readableBytes() method in ReadableBuffers.ByteReadableBufferWrapper
307 return buffer.readableBytes(); in available()
312 if (buffer.readableBytes() == 0) { in read()
321 if (buffer.readableBytes() == 0) { in read()
326 length = Math.min(buffer.readableBytes(), length); in read()
DMessageFramer.java238 int messageLength = bufferChain.readableBytes(); in writeBufferChain()
299 if (buffer != null && buffer.readableBytes() > 0) { in flush()
323 if (buffer != null && buffer.readableBytes() == 0) { in close()
414 int needed = Math.max(len, current.readableBytes() * 2); in write()
425 private int readableBytes() { in readableBytes() method in MessageFramer.BufferChainOutputStream
428 readable += writableBuffer.readableBytes(); in readableBytes()
DMessageDeframer.java212 boolean hasPartialMessage = nextFrame != null && nextFrame.readableBytes() > 0; in close()
248 return unprocessed.readableBytes() == 0; in isStalled()
318 while ((missingBytes = requiredLength - nextFrame.readableBytes()) > 0) { in readRequiredBytes()
341 if (unprocessed.readableBytes() == 0) { in readRequiredBytes()
345 int toRead = Math.min(missingBytes, unprocessed.readableBytes()); in readRequiredBytes()
416 statsTraceCtx.inboundUncompressedSize(nextFrame.readableBytes()); in getUncompressedBody()
DForwardingReadableBuffer.java45 public int readableBytes() { in readableBytes() method in ForwardingReadableBuffer
46 return buf.readableBytes(); in readableBytes()
DWritableBuffer.java51 int readableBytes(); in readableBytes() method
/external/grpc-grpc-java/okhttp/src/main/java/io/grpc/okhttp/
DOkHttpWritableBuffer.java26 private int readableBytes; field in OkHttpWritableBuffer
37 readableBytes += length; in write()
44 readableBytes += 1; in write()
53 public int readableBytes() { in readableBytes() method in OkHttpWritableBuffer
54 return readableBytes; in readableBytes()
/external/grpc-grpc-java/benchmarks/src/main/java/io/grpc/benchmarks/
DByteBufInputStream.java41 int readableBytes = buf.readableBytes(); in drainTo() local
42 buf.readBytes(target, readableBytes); in drainTo()
44 return readableBytes; in drainTo()
50 return buf.readableBytes(); in available()
/external/grpc-grpc-java/alts/src/main/java/io/grpc/alts/internal/
DAltsTsiFrameProtector.java136 unprotectedBytes += buf.readableBytes(); in handleUnprotected()
166 if (in.readableBytes() <= unprotectedBytesLeft) { in handleUnprotected()
169 unprotectedBytesLeft -= in.readableBytes(); in handleUnprotected()
210 ByteBuf buf = in.readRetainedSlice(in.readableBytes()); in addUnhandled()
212 unhandledBytes += buf.readableBytes(); in addUnhandled()
255 int headerBytesToRead = Math.min(in.readableBytes(), header.writableBytes()); in handleHeader()
282 if (buf.readableBytes() <= requiredCiphertextBytes) { in handlePayload()
285 requiredCiphertextBytes -= buf.readableBytes(); in handlePayload()
295 if (buf.readableBytes() <= requiredSuffixBytes) { in handlePayload()
297 requiredSuffixBytes -= buf.readableBytes(); in handlePayload()
[all …]
DAltsChannelCrypter.java68 verify(outBuf.writableBytes() == plainBuf.readableBytes() + TAG_LENGTH); in encrypt()
99 int bytesRead = ciphertextAndTag.readableBytes(); in decrypt()
/external/grpc-grpc-java/alts/src/test/java/io/grpc/alts/internal/
DChannelCrypterNettyTestBase.java80 Collections.singletonList(out.slice(out.readerIndex(), out.readableBytes() - tagLen)); in frameDecryptOfEncrypt()
81 frameDecrypt.tag = out.slice(out.readerIndex() + out.readableBytes() - tagLen, tagLen); in frameDecryptOfEncrypt()
82 frameDecrypt.out = getDirectBuffer(out.readableBytes(), ref); in frameDecryptOfEncrypt()
94 assertThat(frameEncrypt.plain.get(0).slice(0, frameDecrypt.out.readableBytes())) in encryptDecrypt()
103 frameEncrypt.out = getDirectBuffer(plain.readableBytes() + client.getSuffixLength(), ref); in encryptDecryptLarge()
110 assertThat(frameEncrypt.plain.get(0).slice(0, frameDecrypt.out.readableBytes())) in encryptDecryptLarge()
123 assertThat(frameEncrypt.plain.get(0).slice(0, frameDecrypt.out.readableBytes())) in encryptDecryptMultiple()
147 int outLen = out.readableBytes(); in encryptDecryptComposite()
154 frameDecrypt.tag = out.slice(out.readerIndex() + out.readableBytes() - tagLen, tagLen); in encryptDecryptComposite()
155 frameDecrypt.out = getDirectBuffer(out.readableBytes(), ref); in encryptDecryptComposite()
[all …]
DAltsTsiFrameProtectorTest.java178 assertThat(in.readableBytes()).isEqualTo(0); in parserHeader_frameZeroOk()
214 assertThat(in.readableBytes()).isEqualTo(0); in parserHeader_frameMaxOk()
235 assertThat(in1.readableBytes()).isEqualTo(0); in parserHeader_frameOkFragment()
238 assertThat(in2.readableBytes()).isEqualTo(0); in parserHeader_frameOkFragment()
259 assertThat(in1.readableBytes()).isEqualTo(0); in parseHeader_frameFailFragment()
268 assertThat(in2.readableBytes()).isEqualTo(0); in parseHeader_frameFailFragment()
300 assertThat(outFrame.readableBytes()).isEqualTo(0); in parseFrame_oneFrameNoFragment()
351 assertThat(outFrame.readableBytes()).isEqualTo(0); in parseFrame_twoFramesNoFragment()
404 assertThat(protectedBuf.readableBytes()).isEqualTo(0); in parseFrame_twoFramesNoFragment_Leftover()
DByteBufTestUtils.java54 int fragmentSize = buf.readableBytes() / num; in fragmentByteBuf()
56 int readBytes = num == 0 ? buf.readableBytes() : fragmentSize; in fragmentByteBuf()
DAltsChannelCrypterTest.java72 assertThat(frameEncrypt1.plain.get(0).slice(0, frameDecrypt1.out.readableBytes())) in encryptDecryptKdfCounterIncr()
85 assertThat(frameEncrypt2.plain.get(0).slice(0, frameDecrypt2.out.readableBytes())) in encryptDecryptKdfCounterIncr()
/external/grpc-grpc-java/okhttp/src/test/java/io/grpc/okhttp/
DOkHttpWritableBufferAllocatorTest.java44 assertEquals(0, buffer.readableBytes()); in testCapacity()
51 assertEquals(0, buffer.readableBytes()); in testInitialCapacityHasMaximum()
58 assertEquals(0, buffer.readableBytes()); in testIsExactBelowMaxCapacity()
/external/grpc-grpc-java/netty/src/test/java/io/grpc/netty/
DNettyWritableBufferAllocatorTest.java46 assertEquals(0, buffer.readableBytes()); in testCapacityHasMinimum()
53 assertEquals(0, buffer.readableBytes()); in testCapacityIsExactAboveMinimum()
61 assertEquals(0, buffer.readableBytes()); in testCapacityIsCappedAtMaximum()
/external/grpc-grpc-java/netty/src/main/java/io/grpc/netty/
DNettyWritableBuffer.java49 public int readableBytes() { in readableBytes() method in NettyWritableBuffer
50 return bytebuf.readableBytes(); in readableBytes()
DNettyReadableBuffer.java44 public int readableBytes() { in readableBytes() method in NettyReadableBuffer
45 return buffer.readableBytes(); in readableBytes()
/external/grpc-grpc-java/interop-testing/src/test/java/io/grpc/testing/integration/
DTrafficControlProxy.java212 int readableBytes = inStream.read(request); in readIn() local
214 queue.put(new Message(sendTime, request, readableBytes)); in readIn()
215 incrementBytes(readableBytes); in readIn()

12