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


Java GridUnsafe.copyOffheapHeap方法代码示例

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


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

示例1: arrayCopy

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public byte[] arrayCopy() {
    if (dataCopy == null) {
        dataCopy = new byte[len];

        GridUnsafe.copyOffheapHeap(data, dataCopy, GridUnsafe.BYTE_ARR_OFF, dataCopy.length);
    }

    return dataCopy;
}
 
开发者ID:apache,项目名称:ignite,代码行数:11,代码来源:PlatformInputStreamImpl.java

示例2: copyAndShift

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 * Copy required amount of data and shift position.
 *
 * @param target Target to copy data to.
 * @param off Offset.
 * @param cnt Count.
 */
private void copyAndShift(Object target, long off, int cnt) {
    ensureEnoughData(cnt);

    GridUnsafe.copyOffheapHeap(data + pos, target, off, cnt);

    shift(cnt);
}
 
开发者ID:apache,项目名称:ignite,代码行数:15,代码来源:PlatformInputStreamImpl.java

示例3: readByteArray

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 * @param ptr Pointer.
 * @param off Offset.
 * @return Value.
 */
public static byte[] readByteArray(long ptr, int off, int len) {
    byte[] arr0 = new byte[len];

    GridUnsafe.copyOffheapHeap(ptr + off, arr0, GridUnsafe.BYTE_ARR_OFF, len);

    return arr0;
}
 
开发者ID:apache,项目名称:ignite,代码行数:13,代码来源:BinaryPrimitives.java

示例4: readCharArray

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 * @param ptr Pointer.
 * @param off Offset.
 * @return Value.
 */
public static char[] readCharArray(long ptr, int off, int len) {
    char[] arr0 = new char[len];

    GridUnsafe.copyOffheapHeap(ptr + off, arr0, GridUnsafe.CHAR_ARR_OFF, len << 1);

    if (BIG_ENDIAN) {
        for (int i = 0; i < len; i++)
            arr0[i] = Character.reverseBytes(arr0[i]);
    }

    return arr0;
}
 
开发者ID:apache,项目名称:ignite,代码行数:18,代码来源:BinaryPrimitives.java

示例5: arrayCopy

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public byte[] arrayCopy() {
    byte[] res = new byte[pos];

    GridUnsafe.copyOffheapHeap(ptr, res, GridUnsafe.BYTE_ARR_OFF, pos);

    return res;
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:BinaryOffheapOutputStream.java

示例6: arrayCopy

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public byte[] arrayCopy() {
    byte[] res = new byte[len];

    GridUnsafe.copyOffheapHeap(ptr, res, GridUnsafe.BYTE_ARR_OFF, res.length);

    return res;
}
 
开发者ID:apache,项目名称:ignite,代码行数:9,代码来源:BinaryOffheapInputStream.java

示例7: copyAndShift

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void copyAndShift(Object target, long off, int len) {
    GridUnsafe.copyOffheapHeap(ptr + pos, target, off, len);

    shift(len);
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:BinaryOffheapInputStream.java

示例8: readBytes

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 * @param ptr Pointer.
 * @param arr Array.
 * @return The same array as passed in one.
 */
public byte[] readBytes(long ptr, byte[] arr) {
    GridUnsafe.copyOffheapHeap(ptr, arr, GridUnsafe.BYTE_ARR_OFF, arr.length);

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

示例9: add

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 * @param marker Marker.
 * @param ptr Pointer.
 * @param size Size.
 */
private void add(byte marker, long ptr, int size) {
    buf[off++] = marker;

    GridUnsafe.putInt(buf, GridUnsafe.BYTE_ARR_OFF + off, size);

    off += 4;

    GridUnsafe.copyOffheapHeap(ptr, buf, GridUnsafe.BYTE_ARR_OFF + off, size);

    off += size;
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:HadoopShuffleMessage.java


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