本文整理汇总了Java中org.apache.ignite.internal.util.GridUnsafe.putShortLE方法的典型用法代码示例。如果您正苦于以下问题:Java GridUnsafe.putShortLE方法的具体用法?Java GridUnsafe.putShortLE怎么用?Java GridUnsafe.putShortLE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.GridUnsafe
的用法示例。
在下文中一共展示了GridUnsafe.putShortLE方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: writeShortArray
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeShortArray(short[] arr) throws IOException {
writeInt(arr.length);
int bytesToCp = arr.length << 1;
requestFreeSize(bytesToCp);
if (BIG_ENDIAN) {
long off = BYTE_ARR_OFF + this.off;
for (short val : arr) {
GridUnsafe.putShortLE(bytes, off, val);
off += 2;
}
}
else
GridUnsafe.copyMemory(arr, SHORT_ARR_OFF, bytes, BYTE_ARR_OFF + off, bytesToCp);
onWrite(bytesToCp);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}