本文整理汇总了Java中org.apache.ignite.internal.util.GridUnsafe.putChar方法的典型用法代码示例。如果您正苦于以下问题:Java GridUnsafe.putChar方法的具体用法?Java GridUnsafe.putChar怎么用?Java GridUnsafe.putChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.GridUnsafe
的用法示例。
在下文中一共展示了GridUnsafe.putChar方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeChar(char val) {
lastFinished = buf.remaining() >= 2;
if (lastFinished) {
int pos = buf.position();
long off = baseOff + pos;
if (BIG_ENDIAN)
GridUnsafe.putCharLE(heapArr, off, val);
else
GridUnsafe.putChar(heapArr, off, val);
buf.position(pos + 2);
}
}
示例2: writeChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeChar(char val) {
ensureCapacity(pos + 2);
GridUnsafe.putChar(data + pos, val);
shift(2);
}
示例3: writeChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeChar(char val) {
lastFinished = buf.remaining() >= 2;
if (lastFinished) {
int pos = buf.position();
GridUnsafe.putChar(heapArr, baseOff + pos, val);
buf.position(pos + 2);
}
}
示例4: writeChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param arr Array.
* @param off Offset.
* @param val Value.
*/
public static void writeChar(byte[] arr, int off, char val) {
long pos = GridUnsafe.BYTE_ARR_OFF + off;
if (BIG_ENDIAN)
GridUnsafe.putCharLE(arr, pos, val);
else
GridUnsafe.putChar(arr, pos, val);
}
示例5: writeCharFast
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void writeCharFast(char val) {
long addr = ptr + pos;
if (BIG_ENDIAN)
GridUnsafe.putCharLE(addr, val);
else
GridUnsafe.putChar(addr, val);
}
示例6: unsafeWriteChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteChar(char val) {
long addr = ptr + pos;
if (BIG_ENDIAN)
GridUnsafe.putCharLE(addr, val);
else
GridUnsafe.putChar(addr, val);
shift(2);
}
示例7: writeCharFast
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void writeCharFast(char val) {
long off = GridUnsafe.BYTE_ARR_OFF + pos;
if (BIG_ENDIAN)
GridUnsafe.putCharLE(data, off, val);
else
GridUnsafe.putChar(data, off, val);
}
示例8: unsafeWriteChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteChar(char val) {
long off = GridUnsafe.BYTE_ARR_OFF + pos;
if (BIG_ENDIAN)
GridUnsafe.putCharLE(data, off, val);
else
GridUnsafe.putChar(data, off, val);
shift(2);
}
示例9: writeChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeChar(int v) throws IOException {
requestFreeSize(2);
char val = (char)v;
long off = BYTE_ARR_OFF + this.off;
if (BIG_ENDIAN)
GridUnsafe.putCharLE(bytes, off, val);
else
GridUnsafe.putChar(bytes, off, val);
onWrite(2);
}
示例10: writeChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeChar(int val) throws IOException {
int writePos = ensure(2);
GridUnsafe.putChar(buf, BYTE_ARR_OFF + writePos, (char)val);
}
示例11: unsafeWriteChar
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteChar(char val) {
GridUnsafe.putChar(data + pos, val);
shift(2);
}
示例12: writeCharArray
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeCharArray(char[] val) {
int cnt = val.length << 1;
ensureCapacity(pos + cnt);
long startPos = data + pos;
for (char item : val) {
GridUnsafe.putChar(startPos, Character.reverseBytes(item));
startPos += 2;
}
shift(cnt);
}