Example usage for io.netty.buffer ByteBuf readBoolean

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

Introduction

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

Prototype

public abstract boolean readBoolean();

Source Link

Document

Gets a boolean at the current readerIndex and increases the readerIndex by 1 in this buffer.

Usage

From source file:alluxio.network.protocol.RPCUnderFileSystemBlockReadRequest.java

License:Apache License

/**
 * Decodes the input {@link ByteBuf} into a {@link RPCUnderFileSystemBlockReadRequest} object
 * and returns it./*  w  w  w .  java 2s .c  om*/
 *
 * @param in the input {@link ByteBuf}
 * @return The decoded RPCBlockReadRequest object
 */
public static RPCUnderFileSystemBlockReadRequest decode(ByteBuf in) {
    long blockId = in.readLong();
    long offset = in.readLong();
    long length = in.readLong();
    long sessionId = in.readLong();
    boolean noCache = in.readBoolean();
    return new RPCUnderFileSystemBlockReadRequest(blockId, offset, length, sessionId, noCache);
}

From source file:appeng.core.sync.packets.PacketCompassResponse.java

License:Open Source License

public PacketCompassResponse(final ByteBuf stream) {
    this.attunement = stream.readLong();
    this.cx = stream.readInt();
    this.cz = stream.readInt();
    this.cdy = stream.readInt();

    this.cr = new CompassResult(stream.readBoolean(), stream.readBoolean(), stream.readDouble());
}

From source file:appeng.core.sync.packets.PacketConfigButton.java

License:Open Source License

@Reflected
public PacketConfigButton(final ByteBuf stream) {
    this.option = Settings.values()[stream.readInt()];
    this.rotationDirection = stream.readBoolean();
}

From source file:appeng.core.sync.packets.PacketCraftRequest.java

License:Open Source License

public PacketCraftRequest(final ByteBuf stream) {
    this.heldShift = stream.readBoolean();
    this.amount = stream.readLong();
}

From source file:appeng.core.sync.packets.PacketInventoryAction.java

License:Open Source License

public PacketInventoryAction(final ByteBuf stream) throws IOException {
    this.action = InventoryAction.values()[stream.readInt()];
    this.slot = stream.readInt();
    this.id = stream.readLong();
    final boolean hasItem = stream.readBoolean();
    if (hasItem) {
        this.slotItem = AEItemStack.loadItemStackFromPacket(stream);
    } else {// w  w  w .  j a  v  a2 s .  com
        this.slotItem = null;
    }
}

From source file:appeng.core.sync.packets.PacketPatternSlot.java

License:Open Source License

public PacketPatternSlot(final ByteBuf stream) throws IOException {

    this.shift = stream.readBoolean();

    this.slotItem = this.readItem(stream);

    for (int x = 0; x < 9; x++) {
        this.pattern[x] = this.readItem(stream);
    }/* w  w  w .j ava  2  s  . c  om*/
}

From source file:appeng.core.sync.packets.PacketPatternSlot.java

License:Open Source License

private IAEItemStack readItem(final ByteBuf stream) throws IOException {
    final boolean hasItem = stream.readBoolean();

    if (hasItem) {
        return AEItemStack.loadItemStackFromPacket(stream);
    }//from  w w  w  . j a va  2s  .  com

    return null;
}

From source file:appeng.core.sync.packets.PacketTransitionEffect.java

License:Open Source License

public PacketTransitionEffect(final ByteBuf stream) {
    this.x = stream.readFloat();
    this.y = stream.readFloat();
    this.z = stream.readFloat();
    this.d = AEPartLocation.fromOrdinal(stream.readByte());
    this.mode = stream.readBoolean();
}

From source file:appeng.parts.reporting.AbstractPartMonitor.java

License:Open Source License

@Override
public boolean readFromStream(final ByteBuf data) throws IOException {
    boolean needRedraw = super.readFromStream(data);

    final boolean isLocked = data.readBoolean();
    needRedraw = this.isLocked != isLocked;

    this.isLocked = isLocked;

    final boolean val = data.readBoolean();
    if (val) {
        this.configuredItem = AEItemStack.loadItemStackFromPacket(data);
    } else {/* w w w  . j ava  2  s  . c om*/
        this.configuredItem = null;
    }

    return needRedraw;
}

From source file:appeng.parts.reporting.PartStorageMonitor.java

License:Open Source License

@Override
public boolean readFromStream(ByteBuf data) throws IOException {
    boolean stuff = super.readFromStream(data);

    this.spin = data.readByte();
    this.isLocked = data.readBoolean();
    boolean val = data.readBoolean();
    if (val) {
        this.configuredItem = AEItemStack.loadItemStackFromPacket(data);
    } else {/* ww  w.j  a  va2 s  .com*/
        this.configuredItem = null;
    }

    this.updateList = true;

    return stuff;
}