MCPcopy Create free account
hub / github.com/ebarlas/microhttp / add

Method add

src/main/java/org/microhttp/ByteTokenizer.java:33–40  ·  view source on GitHub ↗
(ByteBuffer buffer)

Source from the content-addressed store, hash-verified

31 }
32
33 void add(ByteBuffer buffer) {
34 int bufferLen = buffer.remaining();
35 if (array.length - size < bufferLen) {
36 array = Arrays.copyOf(array, Math.max(size + bufferLen, array.length * 2));
37 }
38 buffer.get(array, size, bufferLen);
39 size += bufferLen;
40 }
41
42 byte[] next(int length) {
43 if (size - position < length) {

Callers 6

completeRequestsMethod · 0.95
partialRequestsMethod · 0.95
invalidRequestsMethod · 0.95
compactMethod · 0.95
nextWithLengthMethod · 0.95
nextWithDelimiterMethod · 0.95

Calls 1

remainingMethod · 0.80

Tested by 6

completeRequestsMethod · 0.76
partialRequestsMethod · 0.76
invalidRequestsMethod · 0.76
compactMethod · 0.76
nextWithLengthMethod · 0.76
nextWithDelimiterMethod · 0.76