本文整理了Java中io.vertx.core.buffer.Buffer.getShortLE()
方法的一些代码示例,展示了Buffer.getShortLE()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.getShortLE()
方法的具体详情如下:
包路径:io.vertx.core.buffer.Buffer
类名称:Buffer
方法名:getShortLE
[英]Gets a 16-bit short integer at the specified absolute index in this buffer in Little Endian Byte Order.
[中]获取此缓冲区中指定绝对索引处的16位短整数,以小尾数字节顺序。
代码示例来源:origin: eclipse-vertx/vert.x
private void testGetSetShort(boolean isLE) throws Exception {
int numShorts = 100;
Buffer b = Buffer.buffer(numShorts * 2);
for (short i = 0; i < numShorts; i++) {
if (isLE) {
b.setShortLE(i * 2, i);
} else {
b.setShort(i * 2, i);
}
}
for (short i = 0; i < numShorts; i++) {
if (isLE) {
assertEquals(i, b.getShortLE(i * 2));
} else {
assertEquals(i, b.getShort(i * 2));
}
}
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Gets a 16-bit short integer at the specified absolute <code>index</code> in this buffer in Little Endian Byte Order.
* @param pos
* @return
*/
public short getShortLE(int pos) {
short ret = delegate.getShortLE(pos);
return ret;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Gets a 16-bit short integer at the specified absolute <code>index</code> in this buffer in Little Endian Byte Order.
* @param pos
* @return
*/
public short getShortLE(int pos) {
short ret = delegate.getShortLE(pos);
return ret;
}
代码示例来源:origin: io.vertx/vertx-core
private void testGetSetShort(boolean isLE) throws Exception {
int numShorts = 100;
Buffer b = Buffer.buffer(numShorts * 2);
for (short i = 0; i < numShorts; i++) {
if (isLE) {
b.setShortLE(i * 2, i);
} else {
b.setShort(i * 2, i);
}
}
for (short i = 0; i < numShorts; i++) {
if (isLE) {
assertEquals(i, b.getShortLE(i * 2));
} else {
assertEquals(i, b.getShort(i * 2));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!