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


Java GridUnsafe.putShort方法代码示例

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


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

示例1: writeShort

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeShort(short val) {
    lastFinished = buf.remaining() >= 2;

    if (lastFinished) {
        int pos = buf.position();

        long off = baseOff + pos;

        if (BIG_ENDIAN)
            GridUnsafe.putShortLE(heapArr, off, val);
        else
            GridUnsafe.putShort(heapArr, off, val);

        buf.position(pos + 2);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:18,代码来源:DirectByteBufferStreamImplV2.java

示例2: writeShort

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeShort(short val) {
    ensureCapacity(pos + 2);

    GridUnsafe.putShort(data + pos, val);

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

示例3: writeShort

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeShort(short val) {
    lastFinished = buf.remaining() >= 2;

    if (lastFinished) {
        int pos = buf.position();

        GridUnsafe.putShort(heapArr, baseOff + pos, val);

        buf.position(pos + 2);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:13,代码来源:DirectByteBufferStreamImplV1.java

示例4: writeShort

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

    if (BIG_ENDIAN)
        GridUnsafe.putShortLE(arr, pos, val);
    else
        GridUnsafe.putShort(arr, pos, val);
}
 
开发者ID:apache,项目名称:ignite,代码行数:14,代码来源:BinaryPrimitives.java

示例5: writeShortFast

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

    if (BIG_ENDIAN)
        GridUnsafe.putShortLE(addr, val);
    else
        GridUnsafe.putShort(addr, val);
}
 
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:BinaryOffheapOutputStream.java

示例6: unsafeWriteShort

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

    if (BIG_ENDIAN)
        GridUnsafe.putShortLE(addr, val);
    else
        GridUnsafe.putShort(addr, val);

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

示例7: writeShortFast

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

    if (BIG_ENDIAN)
        GridUnsafe.putShortLE(data, off, val);
    else
        GridUnsafe.putShort(data, off, val);
}
 
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:BinaryHeapOutputStream.java

示例8: unsafeWriteShort

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

    if (BIG_ENDIAN)
        GridUnsafe.putShortLE(data, off, val);
    else
        GridUnsafe.putShort(data, off, val);

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

示例9: writeShort

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeShort(int v) throws IOException {
    requestFreeSize(2);

    short val = (short)v;

    long off = BYTE_ARR_OFF + this.off;

    if (BIG_ENDIAN)
        GridUnsafe.putShortLE(bytes, off, val);
    else
        GridUnsafe.putShort(bytes, off, val);

    onWrite(2);
}
 
开发者ID:apache,项目名称:ignite,代码行数:16,代码来源:GridUnsafeDataOutput.java

示例10: writeShort

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeShort(int val) throws IOException {
    int writePos = ensure(2);

    GridUnsafe.putShort(buf, BYTE_ARR_OFF + writePos, (short)val);
}
 
开发者ID:apache,项目名称:ignite,代码行数:7,代码来源:HadoopDirectDataOutput.java

示例11: unsafeWriteShort

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteShort(short val) {
    GridUnsafe.putShort(data + pos, val);

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

示例12: writeShortArray

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeShortArray(short[] val) {
    int cnt = val.length << 1;

    ensureCapacity(pos + cnt);

    long startPos = data + pos;

    for (short item : val) {
        GridUnsafe.putShort(startPos, Short.reverseBytes(item));

        startPos += 2;
    }

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

示例13: writeShort

import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
 * @param ptr Pointer.
 * @param v Short value.
 */
public void writeShort(long ptr, short v) {
    GridUnsafe.putShort(ptr, v);
}
 
开发者ID:apache,项目名称:ignite,代码行数:8,代码来源:GridUnsafeMemory.java


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