本文整理汇总了Java中io.netty.buffer.ByteBuf.writeFloat方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBuf.writeFloat方法的具体用法?Java ByteBuf.writeFloat怎么用?Java ByteBuf.writeFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.netty.buffer.ByteBuf
的用法示例。
在下文中一共展示了ByteBuf.writeFloat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override public void serialize(ByteBuf buf) {
try {
lock.readLock().lock();
super.serialize(buf);
buf.writeInt(hashMap.size());
ObjectIterator<Int2FloatMap.Entry> iter = hashMap.int2FloatEntrySet().fastIterator();
Int2FloatMap.Entry entry = null;
while (iter.hasNext()) {
entry = iter.next();
buf.writeInt(entry.getIntKey());
buf.writeFloat(entry.getFloatValue());
}
} finally {
lock.readLock().unlock();
}
}
示例2: serialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeInt(rowId);
buf.writeInt(splitNum);
buf.writeFloat(minChildWeight);
buf.writeFloat(regAlpha);
buf.writeFloat(regLambda);
}
示例3: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeFloat(x);
buf.writeFloat(y);
buf.writeFloat(z);
buf.writeBoolean(airborne);
}
示例4: serialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeInt((int)(end - start));
for (int i = (int)start; i < end; i++) {
buf.writeFloat(values[i]);
}
}
示例5: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
ByteBufUtils.writeUTF8String(buf, name);
buf.writeFloat(pos.getX());
buf.writeFloat(pos.getY());
buf.writeFloat(pos.getZ());
}
示例6: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeFloat(amount);
buf.writeFloat(pos.getX());
buf.writeFloat(pos.getY());
buf.writeFloat(pos.getZ());
}
示例7: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(this.tile.getWorld().provider.getDimension());
buf.writeLong(this.tile.getPos().toLong());
buf.writeInt(this.id);
buf.writeFloat(this.progress);
buf.writeByte(this.direction);
buf.writeInt(this.color);
}
示例8: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(entityID);
ByteBufUtils.writeUTF8String(buf, animationName);
buf.writeBoolean(loopAnim);
buf.writeFloat(transitionTime);
}
示例9: writeSpawnData
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void writeSpawnData(ByteBuf additionalData)
{
ByteBufUtils.writeItemStack(additionalData, knife);
additionalData.writeFloat(baseDamage);
additionalData.writeFloat(force);
}
示例10: testMergeTo
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Test
public void testMergeTo() throws Exception {
ByteBuf buf = Unpooled.buffer(16);
buf.writeFloat((float) 10.00);
buf.writeFloat((float) 11.00);
buf.writeFloat((float) 12.00);
serverDenseFloatRow.update(RowType.T_FLOAT_DENSE, buf, 3);
float[] dataArray = {0, 1, 2, 3, 4};
serverDenseFloatRow.mergeTo(dataArray);
assertEquals(dataArray[0], 10, 0.00);
assertEquals(dataArray[1], 11, 0.00);
assertEquals(dataArray[2], 12, 0.00);
assertEquals(dataArray[3], 3, 0.00);
assertEquals(dataArray[4], 4, 0.00);
}
示例11: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeFloat(min);
buf.writeFloat(pressure);
buf.writeFloat(danger);
buf.writeFloat(crit);
}
示例12: writeSpawnData
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void writeSpawnData(ByteBuf buffer) {
buffer.writeDouble(faerieInformation.getMaxHealth());
buffer.writeFloat(faerieInformation.getSize());
buffer.writeInt(faerieInformation.getType());
buffer.writeInt(faerieInformation.getLevel());
buffer.writeInt(faerieInformation.getCurrentExp());
}
示例13: toBytes
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(this.tile.getWorld().provider.getDimension());
buf.writeLong(this.tile.getPos().toLong());
buf.writeInt(this.id);
ByteBufUtils.writeItemStack(buf, this.stack);
buf.writeFloat(this.progress);
buf.writeByte(this.direction);
buf.writeInt(this.color);
}
示例14: serialize
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeFloat(beta);
}
示例15: write
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void write( ByteBuf buf ) throws IOException {
buf.writeFloat( health );
writeVarInt( food, buf );
buf.writeFloat( foodSaturation );
}