package com.mogo.cloud.live.utils;

import java.nio.ByteBuffer;

public class ByteUtils {

    private static ByteBuffer byteBuffer;

    public static ByteBuffer getBuffer(byte[] bytes, int length) {
        if (byteBuffer == null) {
            byteBuffer = ByteBuffer.allocateDirect(length);
        }
        byteBuffer.put(bytes);
        byteBuffer.flip();
        return byteBuffer;
    }
}
