本文整理汇总了Java中org.apache.ignite.internal.util.GridUnsafe.putByte方法的典型用法代码示例。如果您正苦于以下问题:Java GridUnsafe.putByte方法的具体用法?Java GridUnsafe.putByte怎么用?Java GridUnsafe.putByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ignite.internal.util.GridUnsafe
的用法示例。
在下文中一共展示了GridUnsafe.putByte方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeByte
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeByte(byte val) {
lastFinished = buf.remaining() >= 1;
if (lastFinished) {
int pos = buf.position();
GridUnsafe.putByte(heapArr, baseOff + pos, val);
buf.position(pos + 1);
}
}
示例2: writeArrayLE
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param arr Array.
* @param off Offset.
* @param len Length.
* @param typeSize Primitive type size in bytes.
*/
private void writeArrayLE(Object arr, long off, int len, int typeSize) {
int pos = buf.position();
for (int i = 0; i < len; i++) {
for (int j = 0; j < typeSize; j++) {
byte b = GridUnsafe.getByteField(arr, off + arrOff + (typeSize - j - 1));
GridUnsafe.putByte(heapArr, baseOff + pos++, b);
}
buf.position(pos);
arrOff += typeSize;
}
}
示例3: writeByte
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeByte(int v) throws IOException {
requestFreeSize(1);
GridUnsafe.putByte(bytes, BYTE_ARR_OFF + off, (byte)v);
onWrite(1);
}
示例4: writeByte
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void writeByte(byte val) {
ensureCapacity(pos + 1);
GridUnsafe.putByte(data + pos++, val);
}
示例5: unsafeWriteByte
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteByte(byte val) {
GridUnsafe.putByte(data + pos++, val);
}
示例6: writeByteAndShift
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected void writeByteAndShift(byte val) {
GridUnsafe.putByte(ptr + pos++, val);
}
示例7: unsafeWriteByte
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteByte(byte val) {
GridUnsafe.putByte(ptr + pos++, val);
}
示例8: unsafeWriteByte
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void unsafeWriteByte(byte val) {
GridUnsafe.putByte(data, GridUnsafe.BYTE_ARR_OFF + pos++, val);
}
示例9: testUnsafe
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* Test unsafe vs. new.
*/
@SuppressWarnings("JavaDoc")
private static void testUnsafe() throws InterruptedException {
X.println("Testing unsafe...");
int MAX = 1000000;
long[] addrs = new long[MAX];
System.gc();
GridTimer t = new GridTimer("unsafe");
int mem = 1024;
for (int i = 0; i < MAX; i++) {
addrs[i] = GridUnsafe.allocateMemory(mem);
GridUnsafe.putByte(addrs[i] + RAND.nextInt(mem), (byte)RAND.nextInt(mem));
v = GridUnsafe.getByte(addrs[i] + RAND.nextInt(mem));
}
X.println("Unsafe [time=" + t.stop() + "ms, v=" + v + ']');
Thread.sleep(5000L);
for (long l : addrs)
GridUnsafe.freeMemory(l);
}
示例10: writeByte
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param arr Array.
* @param off Offset.
* @param val Value.
*/
public static void writeByte(byte[] arr, int off, byte val) {
GridUnsafe.putByte(arr, GridUnsafe.BYTE_ARR_OFF + off, val);
}
示例11: writeByte
import org.apache.ignite.internal.util.GridUnsafe; //导入方法依赖的package包/类
/**
* @param ptr Pointer.
* @param v Integer value.
*/
public void writeByte(long ptr, byte v) {
GridUnsafe.putByte(ptr, v);
}