Example usage for io.netty.buffer ByteBuf readFloat

List of usage examples for io.netty.buffer ByteBuf readFloat

Introduction

In this page you can find the example usage for io.netty.buffer ByteBuf readFloat.

Prototype

public abstract float readFloat();

Source Link

Document

Gets a 32-bit floating point number at the current readerIndex and increases the readerIndex by 4 in this buffer.

Usage

From source file:io.github.vastframework.codecs.primitives.DecodingPrimitiveSupport.java

License:Apache License

default float decodeFloat(ByteBuf buffer) {
    return buffer.readFloat();
}

From source file:io.hydramq.core.type.converters.MessagePropertiesConverter.java

License:Open Source License

@Override
public MessageProperties read(final ConversionContext context, final ByteBuf buffer) {
    MessageProperties properties = new MessageProperties();
    int flags = buffer.readInt();
    if ((flags & HAS_STRING_PROPERTIES) == HAS_STRING_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setString(context.read(String.class, buffer), context.read(String.class, buffer));
        }//  ww w .ja  v  a2  s .  c  o m
    }
    if ((flags & HAS_BOOLEAN_PROPERTIES) == HAS_BOOLEAN_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setBoolean(context.read(String.class, buffer), buffer.readBoolean());
        }
    }
    if ((flags & HAS_INTEGER_PROPERTIES) == HAS_INTEGER_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setInteger(context.read(String.class, buffer), buffer.readInt());
        }
    }
    if ((flags & HAS_LONG_PROPERTIES) == HAS_LONG_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setLong(context.read(String.class, buffer), buffer.readLong());
        }
    }
    if ((flags & HAS_FLOAT_PROPERTIES) == HAS_FLOAT_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setFloat(context.read(String.class, buffer), buffer.readFloat());
        }
    }
    if ((flags & HAS_DOUBLE_PROPERTIES) == HAS_DOUBLE_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setDouble(context.read(String.class, buffer), buffer.readDouble());
        }
    }
    if ((flags & HAS_BYTES_PROPERTIES) == HAS_BYTES_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setBytes(context.read(String.class, buffer), context.read(byte[].class, buffer));
        }
    }
    if ((flags & HAS_SHORT_PROPERTIES) == HAS_SHORT_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setShort(context.read(String.class, buffer), buffer.readShort());
        }
    }
    if ((flags & HAS_BYTE_PROPERTIES) == HAS_BYTE_PROPERTIES) {
        int count = buffer.readInt();
        for (int i = 0; i < count; i++) {
            properties.setByte(context.read(String.class, buffer), buffer.readByte());
        }
    }

    return properties;
}

From source file:jayavery.geomastery.packets.CPacketLid.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {

    this.lidAngle = buf.readFloat();
    this.prevLidAngle = buf.readFloat();
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
}

From source file:jp.llv.locapi.PlayerLook.java

License:Open Source License

@Override
public void read(ByteBuf buf) {
    this.yaw = buf.readFloat();
    this.pitch = buf.readFloat();
    this.onGround = buf.readBoolean();
}

From source file:jp.llv.locapi.PlayerPositionAndLook.java

License:Open Source License

@Override
public void read(ByteBuf buf) {
    this.x = buf.readDouble();
    this.y = buf.readDouble();
    this.z = buf.readDouble();
    this.yaw = buf.readFloat();
    this.pitch = buf.readFloat();
    this.flag = buf.readByte();
}

From source file:makeo.gadomancy.common.network.packets.PacketTCNodeBolt.java

License:LGPL

@Override
public void fromBytes(ByteBuf buf) {
    this.x = buf.readFloat();
    this.y = buf.readFloat();
    this.z = buf.readFloat();
    this.targetX = buf.readFloat();
    this.targetY = buf.readFloat();
    this.targetZ = buf.readFloat();
}

From source file:matteroverdrive.api.weapon.WeaponShot.java

License:Open Source License

public WeaponShot(ByteBuf buf) {
    this(buf.readInt(), buf.readFloat(), buf.readFloat(), buf.readInt(), buf.readShort());
    setCount(buf.readByte());
}

From source file:matteroverdrive.entity.weapon.PlasmaBolt.java

License:Open Source License

@Override
public void readSpawnData(ByteBuf additionalData) {
    damage = additionalData.readFloat();
    color = additionalData.readInt();//ww w. ja  va  2  s .c  om
    fireDamageMultiply = additionalData.readFloat();
    life = additionalData.readInt();
}

From source file:matteroverdrive.network.packet.bi.PacketFirePlasmaShot.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    this.shot = new WeaponShot(buf);
    this.sender = buf.readInt();
    this.position = Vec3.createVectorHelper(buf.readDouble(), buf.readDouble(), buf.readDouble());
    this.direction = Vec3.createVectorHelper(buf.readFloat(), buf.readFloat(), buf.readFloat());
}

From source file:matteroverdrive.starmap.data.Quadrant.java

License:Open Source License

public void readFromBuffer(ByteBuf buf) {
    super.readFromBuffer(buf);
    x = buf.readFloat();
    y = buf.readFloat();/*from  w ww .ja  v  a 2s  . c  o  m*/
    z = buf.readFloat();
    size = buf.readFloat();
    int starCount = buf.readInt();
    for (int i = 0; i < starCount; i++) {
        Star star = new Star();
        star.readFromBuffer(buf);
        addStar(star);
        star.setQuadrant(this);
    }
}