Queue<Chunk> toChunkQueue(StreamingOutputCallRequest request) {
        final Queue<Chunk> chunkQueue = new LinkedList<Chunk>();
        int offset = 0;
        final boolean compressable = compressableResponse(request.getResponseType());
        for (ResponseParameters params : request.getResponseParametersList()) {
            chunkQueue.add(new Chunk(params.getIntervalUs(), offset, params.getSize(), compressable));

            // Increment the offset past this chunk.
            // Both buffers need to be circular.
            offset = (offset + params.getSize()) % (
                    compressable ? compressableBuffer.size() : uncompressableBuffer.size());
        }
        return chunkQueue;
    }
Breaks down the request and creates a queue of response chunks for the given request.
grpc/src/test/java/com/linecorp/armeria/internal/common/grpc/TestServiceImpl.java