List of usage examples for io.netty.buffer ByteBuf readBoolean
public abstract boolean readBoolean();
From source file:org.opendaylight.protocol.pcep.impl.object.PCEPExcludeRouteObjectParser.java
License:Open Source License
@Override public Xro parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException { Preconditions.checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty."); final XroBuilder builder = new XroBuilder(); builder.setIgnore(header.isIgnore()); builder.setProcessingRule(header.isProcessingRule()); bytes.skipBytes(FLAGS_OFFSET);/* w ww.j a v a2 s .c o m*/ builder.setFlags(new Flags(bytes.readBoolean())); builder.setSubobject(parseSubobjects(bytes.slice())); return builder.build(); }
From source file:org.spongepowered.clean.network.packet.play.serverbound.ClientSettingsPacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.locale = ByteBufUtil.readString(buffer); this.viewDistance = buffer.readByte(); this.chatmode = ChatMode.values()[ByteBufUtil.readVarInt(buffer)]; this.chatcolors = buffer.readBoolean(); this.skinparts = buffer.readByte(); this.mainhand = MainHand.values()[ByteBufUtil.readVarInt(buffer)]; }
From source file:org.spongepowered.clean.network.packet.play.serverbound.ConfirmTransactionPacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.windowid = buffer.readByte(); this.transactionid = buffer.readShort(); this.state = buffer.readBoolean(); }
From source file:org.spongepowered.clean.network.packet.play.serverbound.PlayerLookPacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.yaw = buffer.readFloat(); this.pitch = buffer.readFloat(); this.onGround = buffer.readBoolean(); }
From source file:org.spongepowered.clean.network.packet.play.serverbound.PlayerPacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.onGround = buffer.readBoolean(); }
From source file:org.spongepowered.clean.network.packet.play.serverbound.PlayerPositionAndLookPacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.x = buffer.readDouble(); this.y = buffer.readDouble(); this.z = buffer.readDouble(); this.yaw = buffer.readFloat(); this.pitch = buffer.readFloat(); this.onGround = buffer.readBoolean(); }
From source file:org.spongepowered.clean.network.packet.play.serverbound.PlayerPositionPacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.x = buffer.readDouble(); this.y = buffer.readDouble(); this.z = buffer.readDouble(); this.onGround = buffer.readBoolean(); }
From source file:org.spongepowered.clean.network.packet.play.serverbound.SteerBoatPacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.right_paddle = buffer.readBoolean(); this.left_paddle = buffer.readBoolean(); }
From source file:org.spongepowered.clean.network.packet.play.serverbound.TabCompletePacket.java
License:MIT License
@Override public void read(ByteBuf buffer) { this.text = ByteBufUtil.readString(buffer); this.command = buffer.readBoolean(); this.hasPosition = buffer.readBoolean(); if (this.hasPosition) { this.position = ByteBufUtil.readPosition(buffer); }// ww w. j av a 2 s. c o m }
From source file:org.spoutcraft.client.network.codec.play.ChunkDataBulkCodec.java
License:MIT License
@Override public ChunkDataBulkMessage decode(ByteBuf buf) throws IOException { final short columnCount = buf.readShort(); final int compressedDataLength = buf.readInt(); final boolean hasSkyLight = buf.readBoolean(); final byte[] compressedData = new byte[compressedDataLength]; buf.readBytes(compressedData, 0, compressedData.length); final int[] columnXs = new int[columnCount]; final int[] columnZs = new int[columnCount]; final short[] primaryBitMaps = new short[columnCount]; final short[] additionalDataBitMaps = new short[columnCount]; for (int i = 0; i < columnCount; i++) { columnXs[i] = buf.readInt();//from w ww.j av a2 s .c om columnZs[i] = buf.readInt(); primaryBitMaps[i] = (short) buf.readUnsignedShort(); additionalDataBitMaps[i] = (short) buf.readUnsignedShort(); } return new ChunkDataBulkMessage(columnCount, compressedDataLength, hasSkyLight, compressedData, columnXs, columnZs, primaryBitMaps, additionalDataBitMaps); }