本文整理了Java中io.vertx.core.buffer.Buffer.setUnsignedIntLE()
方法的一些代码示例,展示了Buffer.setUnsignedIntLE()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.setUnsignedIntLE()
方法的具体详情如下:
包路径:io.vertx.core.buffer.Buffer
类名称:Buffer
方法名:setUnsignedIntLE
[英]Sets the unsigned int at position pos in the Buffer to the value i in the Little Endian Byte Order.
The buffer will expand as necessary to accommodate any value written.
[中]将缓冲区中位置pos处的无符号int设置为小尾端字节顺序的值i。
缓冲区将根据需要扩展以容纳任何写入的值。
代码示例来源:origin: eclipse-vertx/vert.x
private void testGetSetUnsignedInt(boolean isLE) throws Exception {
int numInts = 100;
Buffer b = Buffer.buffer(numInts * 4);
for (int i = 0; i < numInts; i++) {
if (isLE) {
b.setUnsignedIntLE(i * 4, (int) (Integer.MAX_VALUE + (long) i));
} else {
b.setUnsignedInt(i * 4, (int) (Integer.MAX_VALUE + (long) i));
}
}
for (int i = 0; i < numInts; i++) {
if (isLE) {
assertEquals(Integer.toUnsignedLong(Integer.MAX_VALUE + i), b.getUnsignedIntLE(i * 4));
} else {
assertEquals(Integer.toUnsignedLong(Integer.MAX_VALUE + i), b.getUnsignedInt(i * 4));
}
}
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Sets the unsigned <code>int</code> at position <code>pos</code> in the Buffer to the value <code>i</code> in the Little Endian Byte Order.<p>
* The buffer will expand as necessary to accommodate any value written.
* @param pos
* @param i
* @return
*/
public io.vertx.rxjava.core.buffer.Buffer setUnsignedIntLE(int pos, long i) {
delegate.setUnsignedIntLE(pos, i);
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Sets the unsigned <code>int</code> at position <code>pos</code> in the Buffer to the value <code>i</code> in the Little Endian Byte Order.<p>
* The buffer will expand as necessary to accommodate any value written.
* @param pos
* @param i
* @return
*/
public io.vertx.rxjava.core.buffer.Buffer setUnsignedIntLE(int pos, long i) {
delegate.setUnsignedIntLE(pos, i);
return this;
}
代码示例来源:origin: io.vertx/vertx-core
private void testGetSetUnsignedInt(boolean isLE) throws Exception {
int numInts = 100;
Buffer b = Buffer.buffer(numInts * 4);
for (int i = 0; i < numInts; i++) {
if (isLE) {
b.setUnsignedIntLE(i * 4, (int) (Integer.MAX_VALUE + (long) i));
} else {
b.setUnsignedInt(i * 4, (int) (Integer.MAX_VALUE + (long) i));
}
}
for (int i = 0; i < numInts; i++) {
if (isLE) {
assertEquals(Integer.toUnsignedLong(Integer.MAX_VALUE + i), b.getUnsignedIntLE(i * 4));
} else {
assertEquals(Integer.toUnsignedLong(Integer.MAX_VALUE + i), b.getUnsignedInt(i * 4));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!