class KryoSerializers {

    public static byte[] getBuffer(int capacity) {
        if (capacity > THREAD_LOCAL_BUFFER_LIMIT_BYTES) {
            // do not cache larger buffers
            return new byte[capacity];
        }
        byte[] buffer = bufferPerThread.get();
        if (buffer.length < capacity || buffer.length > capacity * 10) {
            buffer = new byte[capacity];
            bufferPerThread.set(buffer);
        }
        return buffer;
    }

    private  KryoSerializers();

}