本文整理汇总了Java中org.apache.ignite.internal.util.GridUnsafe.getShort方法的典型用法代码示例。如果您正苦于以下问题:Java GridUnsafe.getShort方法的具体用法?Java GridUnsafe.getShort怎么用?Java GridUnsafe.getShort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.GridUnsafe
的用法示例。
在下文中一共展示了GridUnsafe.getShort方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readShort
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public short readShort() {
lastFinished = buf.remaining() >= 2;
if (lastFinished) {
int pos = buf.position();
buf.position(pos + 2);
long off = baseOff + pos;
return BIG_ENDIAN ? GridUnsafe.getShortLE(heapArr, off) : GridUnsafe.getShort(heapArr, off);
}
else
return 0;
}
示例2: readShortPositioned
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public short readShortPositioned(int pos) {
int delta = pos + 2 - this.pos;
if (delta > 0)
ensureEnoughData(delta);
return GridUnsafe.getShort(data + pos);
}
示例3: readShort
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public short readShort() {
lastFinished = buf.remaining() >= 2;
if (lastFinished) {
int pos = buf.position();
buf.position(pos + 2);
return GridUnsafe.getShort(heapArr, baseOff + pos);
}
else
return 0;
}
示例4: readShort
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public short readShort() throws IOException {
fromStream(2);
long off = BYTE_ARR_OFF + offset(2);
return BIG_ENDIAN ? GridUnsafe.getShortLE(buf, off) : GridUnsafe.getShort(buf, off);
}
示例5: getShort
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public short getShort(int idx) {
ensure(idx, 2);
return GridUnsafe.getShort(ptr + idx);
}
示例6: readShort
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param arr Array.
* @param off Offset.
* @return Value.
*/
public static short readShort(byte[] arr, int off) {
long pos = GridUnsafe.BYTE_ARR_OFF + off;
return BIG_ENDIAN ? GridUnsafe.getShortLE(arr, pos) : GridUnsafe.getShort(arr, pos);
}
示例7: readShortFast
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected short readShortFast() {
long addr = ptr + pos;
return BIG_ENDIAN ? GridUnsafe.getShortLE(addr) : GridUnsafe.getShort(addr);
}
示例8: readShortPositioned0
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected short readShortPositioned0(int pos) {
long addr = ptr + pos;
return BIG_ENDIAN ? GridUnsafe.getShortLE(addr) : GridUnsafe.getShort(addr);
}
示例9: readShort
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public short readShort() throws IOException {
checkRange(2);
short res = GridUnsafe.getShort(buf, BYTE_ARR_OFF + pos);
pos += 2;
return res;
}
示例10: readShort
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public short readShort() {
ensureEnoughData(2);
short res = GridUnsafe.getShort(data + pos);
shift(2);
return res;
}
示例11: readShortFast
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected short readShortFast() {
long off = GridUnsafe.BYTE_ARR_OFF + pos;
return BIG_ENDIAN ? GridUnsafe.getShortLE(data, off) : GridUnsafe.getShort(data, off);
}
示例12: readShortPositioned0
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected short readShortPositioned0(int pos) {
long off = GridUnsafe.BYTE_ARR_OFF + pos;
return BIG_ENDIAN ? GridUnsafe.getShortLE(data, off) : GridUnsafe.getShort(data, off);
}
示例13: readShort
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param ptr Pointer.
* @return Short value.
*/
public short readShort(long ptr) {
return GridUnsafe.getShort(ptr);
}