本文整理汇总了Java中org.apache.ignite.internal.util.GridUnsafe.getIntLE方法的典型用法代码示例。如果您正苦于以下问题:Java GridUnsafe.getIntLE方法的具体用法?Java GridUnsafe.getIntLE怎么用?Java GridUnsafe.getIntLE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.GridUnsafe
的用法示例。
在下文中一共展示了GridUnsafe.getIntLE方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readIntArray
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public int[] readIntArray() throws IOException {
int arrSize = readInt();
int bytesToCp = arrSize << 2;
fromStream(bytesToCp);
int[] arr = new int[arrSize];
long off = BYTE_ARR_OFF + offset(bytesToCp);
if (BIG_ENDIAN) {
for (int i = 0; i < arr.length; i++) {
arr[i] = GridUnsafe.getIntLE(buf, off);
off += 4;
}
}
else
GridUnsafe.copyMemory(buf, off, arr, INT_ARR_OFF, bytesToCp);
return arr;
}
示例2: readInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public int readInt() throws IOException {
fromStream(4);
long off = BYTE_ARR_OFF + offset(4);
return BIG_ENDIAN ? GridUnsafe.getIntLE(buf, off) : GridUnsafe.getInt(buf, off);
}
示例3: readInt
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param arr Array.
* @param off Offset.
* @return Value.
*/
public static int readInt(byte[] arr, int off) {
long pos = GridUnsafe.BYTE_ARR_OFF + off;
return BIG_ENDIAN ? GridUnsafe.getIntLE(arr, pos) : GridUnsafe.getInt(arr, pos);
}
示例4: readIntFast
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected int readIntFast() {
long off = GridUnsafe.BYTE_ARR_OFF + pos;
return BIG_ENDIAN ? GridUnsafe.getIntLE(data, off) : GridUnsafe.getInt(data, off);
}
示例5: readIntPositioned0
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected int readIntPositioned0(int pos) {
long off = GridUnsafe.BYTE_ARR_OFF + pos;
return BIG_ENDIAN ? GridUnsafe.getIntLE(data, off) : GridUnsafe.getInt(data, off);
}
示例6: readIntFast
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected int readIntFast() {
long addr = ptr + pos;
return BIG_ENDIAN ? GridUnsafe.getIntLE(addr) : GridUnsafe.getInt(addr);
}
示例7: readIntPositioned0
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected int readIntPositioned0(int pos) {
long addr = ptr + pos;
return BIG_ENDIAN ? GridUnsafe.getIntLE(addr) : GridUnsafe.getInt(addr);
}