@@ -0,0 +1,1651 @@
+/*%0A * Copyright 2022 The Android Open Source Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage androidx.camera.camera2.internal.util;%0A%0Aimport androidx.annotation.NonNull;%0A%0Aimport java.util.NoSuchElementException;%0A%0A/**%0A * Acts as a queue with limited space.%0A *%0A * %3Cp%3EOlder entries get dequeued to make space for newer%0A * entries.%3C/p%3E%0A *%0A * @param %3CT%3E the type of elements stored in the RingBuffer.%0A */%0Apublic interface RingBuffer%3CT%3E %7B%0A%0A    /**%0A     * Enqueues an element into the RingBuffer.%0A     *%0A     * @param element the element to be enqueued%0A     */%0A    void enqueue(@NonNull T element);%0A%0A    /**%0A     * Dequeues element from RingBuffer.%0A     *%0A     * @throws NoSuchElementException if the buffer is empty.%0A     *%0A     * @return dequeued element.%0A     */%0A    @NonNull  T dequeue();%0A%0A    /**%0A     * Returns the max capacity of the RingBuffer.%0A     */%0A    int getMaxCapacity();%0A%0A    /**%0A     * Called when an element is removed from the buffer due to capacity.%0A     *%0A     * @param %3CT%3E the type of element stored in the RingBuffer.%0A     */%0A    interface OnRemoveCallback%3CT%3E %7B%0A        void onRemove(T element);%0A    %7D%0A%7D%0A

Create RingBuffer interface to use with ZSL.