io.protostuff.Output.writeFloat()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中io.protostuff.Output.writeFloat()方法的一些代码示例,展示了Output.writeFloat()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Output.writeFloat()方法的具体详情如下:
包路径:io.protostuff.Output
类名称:Output
方法名:writeFloat

Output.writeFloat介绍

[英]Writes a float field.
[中]写入一个浮点字段。

代码示例

代码示例来源:origin: protostuff/protostuff

@Override
public void writeFloat(int fieldNumber, float value, boolean repeated) throws IOException
{
  output.writeFloat(fieldNumber, value, repeated);
}

代码示例来源:origin: protostuff/protostuff

@Override
public void writeTo(Output output, int number, Float value,
    boolean repeated) throws IOException
{
  output.writeFloat(number, value.floatValue(), repeated);
}

代码示例来源:origin: protostuff/protostuff

@Override
public void writeTo(Output output, int number, Float value,
    boolean repeated) throws IOException
{
  output.writeFloat(number, value.floatValue(), repeated);
}

代码示例来源:origin: protostuff/protostuff

@Override
public void writeTo(Output output, int number, Float value,
    boolean repeated) throws IOException
{
  output.writeFloat(number, value.floatValue(), repeated);
}

代码示例来源:origin: protostuff/protostuff

@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
    boolean repeated) throws IOException
{
  output.writeFloat(number, input.readFloat(), repeated);
}

代码示例来源:origin: protostuff/protostuff

@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
    boolean repeated) throws IOException
{
  output.writeFloat(number, input.readFloat(), repeated);
}

代码示例来源:origin: protostuff/protostuff

@Override
public void transfer(Pipe pipe, Input input, Output output, int number,
    boolean repeated) throws IOException
{
  output.writeFloat(number, input.readFloat(), repeated);
}

代码示例来源:origin: protostuff/protostuff

@Override
public void writeTo(Output output, FPNumbers message) throws IOException
{
  if (message.floatValue != null)
    output.writeFloat(1, message.floatValue, false);
  if (message.doubleValue != null)
    output.writeDouble(2, message.doubleValue, false);
}

代码示例来源:origin: protostuff/protostuff

output.writeFloat(ID_ARRAY_DATA, array[i], true);
output.writeFloat(ID_ARRAY_DATA, v, true);

代码示例来源:origin: protostuff/protostuff

output.writeFloat(ID_ARRAY_DATA, array[i], true);
output.writeFloat(ID_ARRAY_DATA, v, true);

代码示例来源:origin: protostuff/protostuff

@Override
public void writeTo(Output output, Bar message) throws IOException
{
  if (message.someInt != 0)
    output.writeInt32(1, message.someInt, false);
  if (message.someString != null)
    output.writeString(2, message.someString, false);
  if (message.someBaz != null)
    output.writeObject(3, message.someBaz, Baz.getSchema(), false);
  if (message.someEnum != null)
    output.writeEnum(4, message.someEnum.number, false);
  if (message.someBytes != null)
    output.writeBytes(5, message.someBytes, false);
  if (message.someBoolean)
    output.writeBool(6, message.someBoolean, false);
  if (message.someFloat != 0f)
    output.writeFloat(7, message.someFloat, false);
  if (message.someDouble != 0d)
    output.writeDouble(8, message.someDouble, false);
  if (message.someLong != 0l)
    output.writeInt64(9, message.someLong, false);
}

代码示例来源:origin: protostuff/protostuff

output.writeFloat(7, value, true);

代码示例来源:origin: org.apache.servicecomb/foundation-protobuf

@Override
 public void writeTo(Output output, Object value) throws IOException {
  if (value == null) {
   return;
  }

  if (value instanceof Number) {
   output.writeFloat(number, ((Number) value).floatValue(), repeated);
   return;
  }

  if (value instanceof String[]) {
   if (((String[]) value).length == 0) {
    return;
   }
   float v = Float.parseFloat(((String[]) value)[0]);
   output.writeFloat(number, v, repeated);
   return;
  }

  if (value instanceof String) {
   float v = Float.parseFloat((String) value);
   output.writeFloat(number, v, repeated);
   return;
  }

  throwNotSupportValue(value);
 }
}

代码示例来源:origin: dremio/dremio-oss

public void writeTo(Output output, ScanStats message) throws IOException
{
  if(message.type != null)
     output.writeEnum(1, message.type.number, false);
  if(message.recordCount != null)
    output.writeInt64(2, message.recordCount, false);
  if(message.cpuCost != null)
    output.writeFloat(3, message.cpuCost, false);
  if(message.diskCost != null)
    output.writeFloat(4, message.diskCost, false);
  if(message.scanFactor != null)
    output.writeDouble(5, message.scanFactor, false);
}

代码示例来源:origin: dremio/dremio-oss

public void writeTo(Output output, TopOperation message) throws IOException
{
  if(message.type == null)
    throw new UninitializedMessageException(message);
  output.writeEnum(1, message.type.number, false);
  if(message.timeConsumed == null)
    throw new UninitializedMessageException(message);
  output.writeFloat(2, message.timeConsumed, false);
}

代码示例来源:origin: dremio/dremio-oss

output.writeFloat(4, message.networkCost, false);
output.writeFloat(5, message.cpuCost, false);
output.writeFloat(6, message.diskCost, false);
output.writeFloat(7, message.memoryCost, false);

代码示例来源:origin: dremio/dremio-oss

public void writeTo(Output output, PartitionValue message) throws IOException
{
  if(message.type != null)
     output.writeEnum(1, message.type.number, false);
  if(message.column != null)
    output.writeString(2, message.column, false);
  if(message.bitValue != null)
    output.writeBool(3, message.bitValue, false);
  if(message.intValue != null)
    output.writeInt32(4, message.intValue, false);
  if(message.longValue != null)
    output.writeInt64(5, message.longValue, false);
  if(message.floatValue != null)
    output.writeFloat(6, message.floatValue, false);
  if(message.doubleValue != null)
    output.writeDouble(7, message.doubleValue, false);
  if(message.binaryValue != null)
    output.writeBytes(8, message.binaryValue, false);
  if(message.stringValue != null)
    output.writeString(9, message.stringValue, false);
}

代码示例来源:origin: dremio/dremio-oss

output.writeFloat(4, message.getNetworkCost(), false);
if(message.hasCpuCost())
  output.writeFloat(5, message.getCpuCost(), false);
if(message.hasDiskCost())
  output.writeFloat(6, message.getDiskCost(), false);
if(message.hasMemoryCost())
  output.writeFloat(7, message.getMemoryCost(), false);
if(message.hasFragmentJson())
  output.writeByteArray(8, message.getFragmentJson().toByteArray(), false);

相关文章