All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.ykiselev.buffers.Buffers Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2017 Yuriy Kiselev ([email protected])
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.ykiselev.buffers;

import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.LongBuffer;
import java.nio.ShortBuffer;

/**
 * Created by Y.Kiselev on 04.06.2016.
 */
public interface Buffers {

    Pooled byteBuffer(int size);

    Pooled charBuffer(int size);

    Pooled shortBuffer(int size);

    Pooled intBuffer(int size);

    Pooled longBuffer(int size);

    Pooled floatBuffer(int size);

    Pooled doubleBuffer(int size);

    /**
     * Pooled buffer. Provides access to encapsulated buffer and returns buffer into pool when closed.
     *
     * @param  the buffer type
     */
    interface Pooled extends AutoCloseable {

        T buffer();

        @Override
        void close();
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy