當前位置: 首頁>>代碼示例>>Java>>正文


Java ByteBuf.readDouble方法代碼示例

本文整理匯總了Java中io.netty.buffer.ByteBuf.readDouble方法的典型用法代碼示例。如果您正苦於以下問題:Java ByteBuf.readDouble方法的具體用法?Java ByteBuf.readDouble怎麽用?Java ByteBuf.readDouble使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.netty.buffer.ByteBuf的用法示例。


在下文中一共展示了ByteBuf.readDouble方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: deserialize

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
  }
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:18,代碼來源:FullPartitionAggrResult.java

示例2: updateDoubleDenseToDoubleDense

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
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));
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:26,代碼來源:DefaultRowUpdater.java

示例3: fromBytes

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
}
 
開發者ID:TheXFactor117,項目名稱:Loot-Slash-Conquer,代碼行數:15,代碼來源:PacketUpdateStats.java

示例4: deserialize

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
  }
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:15,代碼來源:ArrayPartitionAggrResult.java

示例5: deserialize

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
  }
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:16,代碼來源:MMUpdateParam.java

示例6: fromBytes

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:10,代碼來源:PositionMessage.java

示例7: deserialize

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
  }
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:11,代碼來源:VAUpdateParam.java

示例8: fromBytes

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
}
 
開發者ID:raphydaphy,項目名稱:ArcaneMagic,代碼行數:10,代碼來源:PacketAnimaTransfer.java

示例9: deserialize

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
  }
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:11,代碼來源:LongIndexGetResult.java

示例10: readSpawnData

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@Override
public void readSpawnData(ByteBuf additionalData) 	// read it on the client
{ 
	this.ownerX = additionalData.readDouble();
	this.ownerY = additionalData.readDouble();
	this.ownerZ = additionalData.readDouble();
}
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:8,代碼來源:EnderAccelerator.java

示例11: read

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@Override
public void read( ByteBuf buf ) throws IOException {
    x = buf.readDouble();
    y = buf.readDouble();
    z = buf.readDouble();
    onGround = buf.readBoolean();
}
 
開發者ID:lukas81298,項目名稱:FlexMC,代碼行數:8,代碼來源:MessageC0DPlayerPosition.java

示例12: fromBytes

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:16,代碼來源:AbsoluteMovementCommandsImplementation.java

示例13: read

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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();
}
 
開發者ID:lukas81298,項目名稱:FlexMC,代碼行數:10,代碼來源:MessageC0EPPlayerPosAndLook.java

示例14: fromBytes

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@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;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:32,代碼來源:FMLMessage.java

示例15: decode

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
@Override
public void decode(ByteBuf buf) {
	this.freeRam = buf.readLong();
	this.cpuLoad = buf.readDouble();
}
 
開發者ID:CentauriCloud,項目名稱:CentauriCloud,代碼行數:6,代碼來源:PacketServerLoad.java


注:本文中的io.netty.buffer.ByteBuf.readDouble方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。