Example usage for com.google.common.io ByteArrayDataInput readLong

List of usage examples for com.google.common.io ByteArrayDataInput readLong

Introduction

In this page you can find the example usage for com.google.common.io ByteArrayDataInput readLong.

Prototype

@Override
    long readLong();

Source Link

Usage

From source file:ocelot.mods.qp2.TileBasic.java

@Override
protected void C_recievePacket(byte pattern, ByteArrayDataInput data, EntityPlayer ep) {
    switch (pattern) {
    case StC_OPENGUI_FORTUNE:
        this.fortuneInclude = data.readBoolean();
        this.fortuneList.clear();
        int fsize = data.readInt();
        for (int i = 0; i < fsize; i++) {
            this.fortuneList.add(data.readLong());
        }//from  www  . ja v  a  2s  . c o  m
        ep.openGui(QuarryPlus2.instance, QuarryPlus2.guiIdFList, this.worldObj, this.xCoord, this.yCoord,
                this.zCoord);
        break;
    case StC_OPENGUI_SILKTOUCH:
        this.silktouchInclude = data.readBoolean();
        this.silktouchList.clear();
        int ssize = data.readInt();
        for (int i = 0; i < ssize; i++) {
            this.silktouchList.add(data.readLong());
        }
        ep.openGui(QuarryPlus2.instance, QuarryPlus2.guiIdSList, this.worldObj, this.xCoord, this.yCoord,
                this.zCoord);
        break;
    }
}

From source file:org.apache.hadoop.hbase.client.Mutation.java

/**
 * @return the set of clusterIds that have consumed the mutation
 *//*from w  w  w .  j a  v a2s. c  o  m*/
public List<UUID> getClusterIds() {
    List<UUID> clusterIds = new ArrayList<UUID>();
    byte[] bytes = getAttribute(CONSUMED_CLUSTER_IDS);
    if (bytes != null) {
        ByteArrayDataInput in = ByteStreams.newDataInput(bytes);
        int numClusters = in.readInt();
        for (int i = 0; i < numClusters; i++) {
            clusterIds.add(new UUID(in.readLong(), in.readLong()));
        }
    }
    return clusterIds;
}