Guava ByteArrayDataInput - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava ByteArrayDataInput class.

This code example shows how to use the following methods:readBoolean
    } 
 
    @Override 
    public void decode(ByteArrayDataInput input)
    { 
        add = input.readBoolean();
        loc = BlockLocation.readFromData(input, true, 0);
    } 
 
    @Override 
    public void actionClient(World world, EntityPlayer player)
    { 
        if (add) // add
        { 
            OwnershipManager.setOwnership(player.getUniqueID(), loc);
        } 
        else // remove 
        { 
            OwnershipManager.removeBlock(loc);
        } 
5
CodeRank
This code example shows how to use the following methods:readFully, readShort
/** 
 * Reads a compressed NBTTagCompound from the InputStream 
 */ 
public static NBTTagCompound readNBTTagCompound(ByteArrayDataInput data)
  { 
  short var1 = data.readShort();
   
  if (var1 < 0)
    { 
    return null; 
    } 
  else 
    { 
    byte[] var2 = new byte[var1];
    data.readFully(var2);
    try 
      { 
      return CompressedStreamTools.decompress(var2);
      }  
    catch (IOException e)
4
CodeRank
This code example shows how to use the following methods:readDouble
        this.y = vec.y();
    } 
     
    public Vector2(ByteArrayDataInput data)
    { 
        this(data.readDouble(), data.readDouble());
    } 
     
    public Vector2(NBTTagCompound nbt)
    { 
        this(nbt.getDouble("x"), nbt.getDouble("y"));
    } 
 
    @Override 
    public double x() 
    { 
        return this.x;
    } 
 
    @Override 
3
CodeRank