当前位置: 首页>>代码示例>>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;未经允许,请勿转载。