Java Code Examples for io.netty.buffer.ByteBuf.readDouble()

The following are Jave code examples for showing how to use readDouble() of the io.netty.buffer.ByteBuf class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: angel   File: FullPartitionAggrResult.java   Source Code and License Vote up 6 votes
@Override
public void deserialize(ByteBuf buf) {
  int rows = buf.readInt();
  int cols = buf.readInt();
  result = new double[rows][cols];
  for (int i = 0; i < rows; i++) {
    for (int j = 0; j < cols; j++) {
      result[i][j] = buf.readDouble();
    }
  }

  int infoSize = buf.readInt();
  partInfo = new int[infoSize];
  for (int i = 0; i < infoSize; i++) {
    partInfo[i] = buf.readInt();
  }
}
 
Example 2
Project: angel   File: DefaultRowUpdater.java   Source Code and License Vote up 6 votes
public void updateDoubleDenseToDoubleDense(int size, ByteBuf buf, ServerDenseDoubleRow row,
    int compressRatio) {
  int bitPerItem = 8 * 8 / compressRatio;

  DoubleBuffer data = row.getData();

  LOG.debug("update double to double, size: " + size);

  if (size <= 0)
    return;

  double maxAbs = buf.readDouble();
  int maxPoint = (int) Math.pow(2, bitPerItem - 1) - 1;

  for (int i = 0; i < size - 1; i++) {
    byte[] itemBytes = new byte[bitPerItem / 8];
    buf.readBytes(itemBytes);
    int point = byteArray2int(itemBytes);
    double parsedValue = (double) point / (double) maxPoint * maxAbs;
    data.put(i, data.get(i) + parsedValue);
  }

  LOG.info(String.format("parse compressed %d double data, max abs: %f, max point: %d", size - 1,
      maxAbs, maxPoint));
}
 
Example 3
Project: Loot-Slash-Conquer   File: PacketUpdateStats.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf) 
{
	mana = buf.readInt();
	maxMana = buf.readInt();
	manaPerSecond = buf.readInt();
	
	magicalPower = buf.readDouble();
	
	healthPerSecond = buf.readInt();
	
	criticalChance = buf.readDouble();
	criticalDamage = buf.readDouble();
}
 
Example 4
Project: angel   File: ArrayPartitionAggrResult.java   Source Code and License Vote up 5 votes
@Override
public void deserialize(ByteBuf buf) {
  int resultSize = buf.readInt();
  result = new double[resultSize];
  for (int i = 0; i < resultSize; i++) {
    result[i] = buf.readDouble();
  }

  int colSize = buf.readInt();
  cols = new long[colSize];
  for (int i = 0; i < colSize; i++) {
    cols[i] = buf.readLong();
  }
}
 
Example 5
Project: angel   File: MMUpdateParam.java   Source Code and License Vote up 5 votes
@Override
public void deserialize(ByteBuf buf) {
  super.deserialize(buf);
  int rowLength = buf.readInt();
  this.rowIds = new int[rowLength];
  for (int i = 0; i < rowLength; i++) {
    this.rowIds[i] = buf.readInt();
  }

  int scalarLength = buf.readInt();
  this.scalars = new double[scalarLength];
  for (int i = 0; i < scalarLength; i++) {
    this.scalars[i] = buf.readDouble();
  }
}
 
Example 6
Project: minecraft-quiverbow   File: PositionMessage.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf)
{
	// the order is important
	this.entityID = buf.readInt();
	this.posX = buf.readDouble();
	this.posY = buf.readDouble();
	this.posZ = buf.readDouble();
}
 
Example 7
Project: angel   File: VAUpdateParam.java   Source Code and License Vote up 5 votes
@Override
public void deserialize(ByteBuf buf) {
  super.deserialize(buf);
  rowId = buf.readInt();
  int length = buf.readInt();
  array = new double[length];
  for (int i = 0; i < length; i++) {
    array[i] = buf.readDouble();
  }
}
 
Example 8
Project: ArcaneMagic   File: PacketAnimaTransfer.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf)
{
	from = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
	to = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
	toCosmetic = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble());
	anima = AnimaStack.readFromBuf(buf);
	spawnParticles = buf.readBoolean();
}
 
Example 9
Project: angel   File: LongIndexGetResult.java   Source Code and License Vote up 5 votes
@Override
public void deserialize(ByteBuf buf) {
  partKey = new PartitionKey();
  partKey.deserialize(buf);
  int len = buf.readInt();
  values = new double[len];
  for (int i = 0; i < len; i++) {
    values[i] = buf.readDouble();
  }
}
 
Example 10
Project: minecraft-quiverbow   File: EnderAccelerator.java   Source Code and License Vote up 5 votes
@Override
public void readSpawnData(ByteBuf additionalData) 	// read it on the client
{ 
	this.ownerX = additionalData.readDouble();
	this.ownerY = additionalData.readDouble();
	this.ownerZ = additionalData.readDouble();
}
 
Example 11
Project: FlexMC   File: MessageC0DPlayerPosition.java   Source Code and License Vote up 5 votes
@Override
public void read( ByteBuf buf ) throws IOException {
    x = buf.readDouble();
    y = buf.readDouble();
    z = buf.readDouble();
    onGround = buf.readBoolean();
}
 
Example 12
Project: Proyecto-DASI   File: AbsoluteMovementCommandsImplementation.java   Source Code and License Vote up 5 votes
@Override
public void fromBytes(ByteBuf buf)
{
    this.x = buf.readDouble();
    this.y = buf.readDouble();
    this.z = buf.readDouble();
    this.yaw = buf.readFloat();
    this.pitch = buf.readFloat();

    this.setX = buf.readBoolean();
    this.setY = buf.readBoolean();
    this.setZ = buf.readBoolean();
    this.setYaw = buf.readBoolean();
    this.setPitch = buf.readBoolean();
}
 
Example 13
Project: FlexMC   File: MessageC0EPPlayerPosAndLook.java   Source Code and License Vote up 5 votes
@Override
public void read( ByteBuf buf ) throws IOException {
    x = buf.readDouble();
    y = buf.readDouble();
    z = buf.readDouble();
    yaw = buf.readFloat();
    pitch = buf.readFloat();
    onGround = buf.readBoolean();
}
 
Example 14
Project: CustomWorldGen   File: FMLMessage.java   Source Code and License Vote up 5 votes
@Override
void fromBytes(ByteBuf dat)
{
    super.fromBytes(dat);
    modId = ByteBufUtils.readUTF8String(dat);
    modEntityTypeId = dat.readInt();
    entityUUID = new UUID(dat.readLong(), dat.readLong());
    rawX = dat.readDouble();
    rawY = dat.readDouble();
    rawZ = dat.readDouble();
    scaledYaw = dat.readByte() * 360F / 256F;
    scaledPitch = dat.readByte() * 360F / 256F;
    scaledHeadYaw = dat.readByte() * 360F / 256F;
    try
    {
        dataWatcherList = EntityDataManager.readEntries(new PacketBuffer(dat));
    } catch (IOException e)
    {
        FMLLog.log(Level.FATAL, e, "There was a critical error decoding the datawatcher stream for a mod entity.");
        throw Throwables.propagate(e);
    }

    throwerId = dat.readInt();
    if (throwerId != 0)
    {
        speedScaledX = dat.readInt() / 8000D;
        speedScaledY = dat.readInt() / 8000D;
        speedScaledZ = dat.readInt() / 8000D;
    }
    this.dataStream = dat;
}
 
Example 15
Project: CentauriCloud   File: PacketServerLoad.java   Source Code and License Vote up 4 votes
@Override
public void decode(ByteBuf buf) {
	this.freeRam = buf.readLong();
	this.cpuLoad = buf.readDouble();
}
 
Example 16
Project: angel   File: MapWithIndexFuncTest.java   Source Code and License Vote up 4 votes
@Override
public void deserialize(ByteBuf buf) {
  multiplier = buf.readDouble();
}
 
Example 17
Project: connor41-etfuturum2   File: BlackHeartParticlesMessage.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buf) {
	x = buf.readDouble();
	y = buf.readDouble();
	z = buf.readDouble();
}
 
Example 18
Project: pnc-repressurized   File: LocationDoublePacket.java   Source Code and License Vote up 4 votes
@Override
public void fromBytes(ByteBuf buf) {
    x = buf.readDouble();
    y = buf.readDouble();
    z = buf.readDouble();
}
 
Example 19
Project: angel   File: MulScalar.java   Source Code and License Vote up 4 votes
@Override
public void deserialize(ByteBuf buf) {
  multiplier = buf.readDouble();
}
 
Example 20
Project: angel   File: ADMMZUpdater.java   Source Code and License Vote up 4 votes
@Override
public void deserialize(ByteBuf buf) {
  kappa = buf.readDouble();
}