Example usage for io.netty.buffer ByteBuf writeBoolean

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

Introduction

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

Prototype

public abstract ByteBuf writeBoolean(boolean value);

Source Link

Document

Sets the specified boolean at the current writerIndex and increases the writerIndex by 1 in this buffer.

Usage

From source file:com.gmail.socraticphoenix.forge.randore.packet.RandoresTexturePacket.java

License:Open Source License

@Override
public void toBytes(ByteBuf buf) {
    buf.writeBoolean(this.loading);
}

From source file:com.heliosapm.ohcrs.core.AbstractDriverCodec.java

License:Apache License

/**
 * Writes the segment prefix which is a short indicating the DBType and a boolean where false is null and true is not-null.
 * @param o The object being written so we can test it for null
 * @param t The DBType of the object being written
 * @param b The buffer to write to/*from   w  ww  .j  a  v a 2s. c  o  m*/
 * @return true if the value was not null, false otherwise
 */
@SuppressWarnings("static-method")
protected boolean prefix(final Object o, DBType t, final ByteBuf b) {
    b.writeShort(t.code());
    final boolean notNull = (o == P || o != null);
    b.writeBoolean(notNull);
    return notNull;
}

From source file:com.heliosapm.ohcrs.core.AbstractDriverCodec.java

License:Apache License

/**
 * {@inheritDoc}//from ww  w  . j av a 2s.co  m
 * @see com.heliosapm.ohcrs.core.DriverCodec#write(boolean, io.netty.buffer.ByteBuf)
 */
@Override
public int write(final Boolean p, final ByteBuf b) throws SQLException {
    prefix(p, DBType.BOOLEAN, b);
    b.writeBoolean(p);
    return b.writerIndex();
}

From source file:com.heliosapm.ohcrs.core.AbstractDriverCodec.java

License:Apache License

/**
 * {@inheritDoc}/*from  w ww  . j ava2 s  . c  o  m*/
 * @see com.heliosapm.ohcrs.core.DriverCodec#write(boolean, io.netty.buffer.ByteBuf)
 */
@Override
public int write(final boolean p, final ByteBuf b) throws SQLException {
    prefix(P, DBType.BOOLEAN, b);
    b.writeBoolean(p);
    return b.writerIndex();
}

From source file:com.kaijin.AdvPowerMan.tileentities.TEBatteryStation.java

License:Open Source License

@Override
protected void addUniqueDescriptionData(ByteBuf data) throws IOException {
    data.writeBoolean(doingWork);
}

From source file:com.kaijin.AdvPowerMan.tileentities.TEChargingBench.java

License:Open Source License

@Override
protected void addUniqueDescriptionData(ByteBuf data) throws IOException {
    data.writeInt(chargeLevel);/*from   ww w.ja va 2 s.c o m*/
    data.writeBoolean(doingWork);
}

From source file:com.kaijin.AdvPowerMan.tileentities.TEStorageMonitor.java

License:Open Source License

@Override
protected void addUniqueDescriptionData(ByteBuf data) throws IOException {
    data.writeInt(chargeLevel);/*from  w  ww . jav  a 2s. co m*/
    data.writeBoolean(isPowering);
    data.writeBoolean(blockState);
}

From source file:com.kegare.caveworld.network.RegenerateMessage.java

License:Minecraft Mod Public

@Override
public void toBytes(ByteBuf buffer) {
    buffer.writeBoolean(backup);
}

From source file:com.kegare.frozenland.core.Config.java

License:Minecraft Mod Public

@Override
public void toBytes(ByteBuf buf) {
    buf.writeInt(dimensionFrozenland);//from w w  w  .  j  av a  2  s. c o  m
    buf.writeInt(biomeFrozenland);
    buf.writeBoolean(generateCaves);
    buf.writeBoolean(generateRavine);
    buf.writeBoolean(generateMineshaft);
    buf.writeBoolean(generateVillage);
    buf.writeBoolean(generateDungeons);
}

From source file:com.minestellar.core.network.message.MessageAntennaOnline.java

License:Open Source License

@Override
public void toBytes(ByteBuf buf) {
    buf.writeBoolean(isOnline);
    buf.writeInt(x);
    buf.writeInt(y);
    buf.writeInt(z);
}