Skip to content

Commit 847a9e3

Browse files
committed
core: remove unused method from CompositeReadableBuffer
1 parent 322e488 commit 847a9e3

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

core/src/main/java/io/grpc/internal/CompositeReadableBuffer.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.nio.InvalidMarkException;
2424
import java.util.ArrayDeque;
2525
import java.util.Deque;
26-
import java.util.Queue;
2726
import javax.annotation.Nullable;
2827

2928
/**
@@ -39,7 +38,6 @@ public class CompositeReadableBuffer extends AbstractReadableBuffer {
3938
private final Deque<ReadableBuffer> readableBuffers;
4039
private Deque<ReadableBuffer> rewindableBuffers;
4140
private int readableBytes;
42-
private final Queue<ReadableBuffer> buffers = new ArrayDeque<ReadableBuffer>(2);
4341
private boolean marked;
4442

4543
public CompositeReadableBuffer(int initialCapacity) {
@@ -161,31 +159,6 @@ public void readBytes(OutputStream dest, int length) throws IOException {
161159
execute(STREAM_OP, length, dest, 0);
162160
}
163161

164-
/**
165-
* Reads {@code length} bytes from this buffer and writes them to the destination buffer.
166-
* Increments the read position by {@code length}. If the required bytes are not readable, throws
167-
* {@link IndexOutOfBoundsException}.
168-
*
169-
* @param dest the destination buffer to receive the bytes.
170-
* @param length the number of bytes to be copied.
171-
* @throws IndexOutOfBoundsException if required bytes are not readable
172-
*/
173-
public void readBytes(CompositeReadableBuffer dest, int length) {
174-
checkReadable(length);
175-
readableBytes -= length;
176-
177-
while (length > 0) {
178-
ReadableBuffer buffer = buffers.peek();
179-
if (buffer.readableBytes() > length) {
180-
dest.addBuffer(buffer.readBytes(length));
181-
length = 0;
182-
} else {
183-
dest.addBuffer(buffers.poll());
184-
length -= buffer.readableBytes();
185-
}
186-
}
187-
}
188-
189162
@Override
190163
public ReadableBuffer readBytes(int length) {
191164
if (length <= 0) {

0 commit comments

Comments
 (0)