本文整理了Java中io.vertx.core.buffer.Buffer.getFloat()
方法的一些代码示例,展示了Buffer.getFloat()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.getFloat()
方法的具体详情如下:
包路径:io.vertx.core.buffer.Buffer
类名称:Buffer
方法名:getFloat
[英]Returns the float at position pos in the Buffer.
[中]返回缓冲区中位置pos处的浮点值。
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public Float decodeFromWire(int pos, Buffer buffer) {
return buffer.getFloat(pos);
}
代码示例来源:origin: eclipse-vertx/vert.x
private void testSetFloat(Buffer buff) throws Exception {
for (int i = 0; i < numSets; i++) {
buff.setFloat(i * 4, (float) i);
}
for (int i = 0; i < numSets; i++) {
assertEquals((float) i, buff.getFloat(i * 4), 0);
}
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testGetFloat() throws Exception {
int numFloats = 100;
Buffer b = Buffer.buffer(numFloats * 4);
for (int i = 0; i < numFloats; i++) {
b.setFloat(i * 4, i);
}
for (int i = 0; i < numFloats; i++) {
assertEquals((float) i, b.getFloat(i * 4), 0);
}
}
代码示例来源:origin: io.vertx/vertx-core
@Override
public Float decodeFromWire(int pos, Buffer buffer) {
return buffer.getFloat(pos);
}
代码示例来源:origin: eclipse-vertx/vert.x
assertIndexOutOfBoundsException(() -> b.getLong(-1));
assertIndexOutOfBoundsException(() -> b.getLong(-100));
assertIndexOutOfBoundsException(() -> b.getFloat(bytesLen));
assertIndexOutOfBoundsException(() -> b.getFloat(bytesLen + 1));
assertIndexOutOfBoundsException(() -> b.getFloat(bytesLen + 100));
assertIndexOutOfBoundsException(() -> b.getFloat(-1));
assertIndexOutOfBoundsException(() -> b.getFloat(-100));
assertIndexOutOfBoundsException(() -> b.getDouble(bytesLen));
assertIndexOutOfBoundsException(() -> b.getDouble(bytesLen + 1));
代码示例来源:origin: io.vertx/vertx-core
private void testSetFloat(Buffer buff) throws Exception {
for (int i = 0; i < numSets; i++) {
buff.setFloat(i * 4, (float) i);
}
for (int i = 0; i < numSets; i++) {
assertEquals((float) i, buff.getFloat(i * 4), 0);
}
}
代码示例来源:origin: io.vertx/vertx-core
@Test
public void testGetFloat() throws Exception {
int numFloats = 100;
Buffer b = Buffer.buffer(numFloats * 4);
for (int i = 0; i < numFloats; i++) {
b.setFloat(i * 4, i);
}
for (int i = 0; i < numFloats; i++) {
assertEquals((float) i, b.getFloat(i * 4), 0);
}
}
代码示例来源:origin: vert-x3/vertx-web
break;
case TYPE_FLOAT:
val = buffer.getFloat(pos);
pos += 4;
break;
代码示例来源:origin: vert-x3/vertx-rx
/**
* Returns the <code>float</code> at position <code>pos</code> in the Buffer.
* @param pos
* @return
*/
public float getFloat(int pos) {
float ret = delegate.getFloat(pos);
return ret;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Returns the <code>float</code> at position <code>pos</code> in the Buffer.
* @param pos
* @return
*/
public float getFloat(int pos) {
float ret = delegate.getFloat(pos);
return ret;
}
代码示例来源:origin: io.vertx/vertx-core
assertIndexOutOfBoundsException(() -> b.getLong(-1));
assertIndexOutOfBoundsException(() -> b.getLong(-100));
assertIndexOutOfBoundsException(() -> b.getFloat(bytesLen));
assertIndexOutOfBoundsException(() -> b.getFloat(bytesLen + 1));
assertIndexOutOfBoundsException(() -> b.getFloat(bytesLen + 100));
assertIndexOutOfBoundsException(() -> b.getFloat(-1));
assertIndexOutOfBoundsException(() -> b.getFloat(-100));
assertIndexOutOfBoundsException(() -> b.getDouble(bytesLen));
assertIndexOutOfBoundsException(() -> b.getDouble(bytesLen + 1));
代码示例来源:origin: com.jukusoft/vertx-binary-serializer
float floatValue = msg.getFloat(_pos);
_pos += 4;
代码示例来源:origin: io.vertx/vertx-web
break;
case TYPE_FLOAT:
val = buffer.getFloat(pos);
pos += 4;
break;
内容来源于网络,如有侵权,请联系作者删除!