Example usage for com.google.common.io ByteArrayDataOutput writeInt

List of usage examples for com.google.common.io ByteArrayDataOutput writeInt

Introduction

In this page you can find the example usage for com.google.common.io ByteArrayDataOutput writeInt.

Prototype

@Override
    void writeInt(int v);

Source Link

Usage

From source file:com.freyja.FES.common.packets.PacketPurgeNetwork.java

@Override
protected void write(ByteArrayDataOutput output) {
    output.writeInt(x);
    output.writeInt(y);
    output.writeInt(z);
}

From source file:cherry.foundation.crypto.SecureIntegerEncoder.java

@Override
protected byte[] typeToBytes(Integer p) {
    ByteArrayDataOutput out = ByteStreams.newDataOutput();
    out.writeInt(p.intValue());
    return out.toByteArray();
}

From source file:eplus.network.packets.EnchantPacket.java

@Override
public void write(ByteArrayDataOutput output) {
    output.writeInt(cost);
    output.writeInt(map.size());//from ww  w . j  av  a 2  s  .  com

    for (Integer enchantmentId : map.keySet()) {
        output.writeInt(enchantmentId);
        output.writeInt(map.get(enchantmentId));
    }
}

From source file:shadowmage.ancient_warfare.common.network.Packet04Npc.java

@Override
public void writeDataToStream(ByteArrayDataOutput data) {
    data.writeInt(entityID);
}

From source file:cherry.goods.crypto.DefaultVersionStrategy.java

@Override
public byte[] encode(byte[] data, Integer version) {
    ByteArrayDataOutput out = ByteStreams.newDataOutput();
    out.writeInt(version.intValue());
    out.write(data);/*from ww  w . j a va  2  s .  c o  m*/
    return out.toByteArray();
}

From source file:de.paleocrafter.pmfw.network.packet.TileDataPacket.java

@Override
public void write(ByteArrayDataOutput out) {
    out.writeInt(x);
    out.writeInt(y);/*from ww  w.j a v a 2  s .c o  m*/
    out.writeInt(z);
    out.writeInt(data.length);
    out.write(data);
}

From source file:de.mineformers.powergrid.network.packet.PacketSyncCable.java

@Override
public void write(ByteArrayDataOutput out) {
    out.writeInt(x);
    out.writeInt(y);//from w w  w  .j a  v  a2s .  co  m
    out.writeInt(z);
    out.writeInt(connections.size());
    for (ForgeDirection dir : connections) {
        out.writeByte(dir.ordinal());
    }
}

From source file:cherry.foundation.crypto.SecureBigDecimalEncoder.java

@Override
protected byte[] typeToBytes(BigDecimal p) {
    int scale = p.scale();
    BigInteger bi = p.scaleByPowerOfTen(scale).toBigIntegerExact();
    ByteArrayDataOutput out = ByteStreams.newDataOutput();
    out.writeInt(scale);
    out.write(bi.toByteArray());// ww  w.java2  s  . c  om
    return out.toByteArray();
}

From source file:nxminetilities.network.MultilightPacket.java

@Override
public void write(ByteArrayDataOutput out) {
    out.writeInt(x);
    out.writeInt(y);/*from   w w  w .j a va2  s.  co m*/
    out.writeInt(z);
    out.writeDouble(lightColourRed);
    out.writeDouble(lightColourGreen);
    out.writeDouble(lightColourBlue);
    out.writeBoolean(lightEnabled);
}

From source file:shadowmage.ancient_framework.common.network.Packet04TE.java

@Override
public void writeDataToStream(ByteArrayDataOutput data) {
    data.writeInt(x);
    data.writeInt(y);
    data.writeInt(z);
}