当前位置: 首页>>代码示例>>Java>>正文


Java GridUnsafe.getLongLE方法代码示例

本文整理汇总了Java中org.apache.ignite.internal.util.GridUnsafe.getLongLE方法的典型用法代码示例。如果您正苦于以下问题:Java GridUnsafe.getLongLE方法的具体用法?Java GridUnsafe.getLongLE怎么用?Java GridUnsafe.getLongLE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ignite.internal.util.GridUnsafe的用法示例。


在下文中一共展示了GridUnsafe.getLongLE方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readLongArray

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public long[] readLongArray() throws IOException {
    int arrSize = readInt();

    int bytesToCp = arrSize << 3;

    fromStream(bytesToCp);

    long[] arr = new long[arrSize];

    long off = BYTE_ARR_OFF + offset(bytesToCp);

    if (BIG_ENDIAN) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] = GridUnsafe.getLongLE(buf, off);

            off += 8;
        }
    }
    else
        GridUnsafe.copyMemory(buf, off, arr, LONG_ARR_OFF, bytesToCp);

    return arr;
}
 
开发者ID:apache,项目名称:ignite,代码行数:25,代码来源:GridUnsafeDataInput.java

示例2: readLong

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public long readLong() throws IOException {
    fromStream(8);

    long off = BYTE_ARR_OFF + offset(8);

    return BIG_ENDIAN ? GridUnsafe.getLongLE(buf, off) : GridUnsafe.getLong(buf, off);
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:GridUnsafeDataInput.java

示例3: readLong

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 * @param arr Array.
 * @param off Offset.
 * @return Value.
 */
public static long readLong(byte[] arr, int off) {
    long pos = GridUnsafe.BYTE_ARR_OFF + off;

    return BIG_ENDIAN ? GridUnsafe.getLongLE(arr, pos) : GridUnsafe.getLong(arr, pos);
}
 
开发者ID:apache,项目名称:ignite,代码行数:11,代码来源:BinaryPrimitives.java

示例4: readLongFast

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected long readLongFast() {
    long off = GridUnsafe.BYTE_ARR_OFF + pos;

    return BIG_ENDIAN ? GridUnsafe.getLongLE(data, off) : GridUnsafe.getLong(data, off);
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:BinaryHeapInputStream.java

示例5: readLongFast

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected long readLongFast() {
    long addr = ptr + pos;

    return BIG_ENDIAN ? GridUnsafe.getLongLE(addr) : GridUnsafe.getLong(addr);
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:BinaryOffheapInputStream.java


注:本文中的org.apache.ignite.internal.util.GridUnsafe.getLongLE方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。