com.esotericsoftware.kryo.io.Output.writeLong()方法的使用及代码示例

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

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

Output.writeLong介绍

[英]Writes an 8 byte long. Uses BIG_ENDIAN byte order.
[中]写入一个8字节长的文件。使用BIG_ENDIAN字节顺序。

代码示例

代码示例来源:origin: apache/incubator-dubbo

@Override
public void writeLong(long v) throws IOException {
  output.writeLong(v);
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public void writeLong(long v) throws IOException {
  output.writeLong(v);
}

代码示例来源:origin: apache/storm

@Override
public void write(Kryo kryo, Output output, RichSpoutBatchId id) {
  output.writeLong(id._id);
}

代码示例来源:origin: alibaba/jstorm

@Override
public void write(Kryo kryo, Output output, RichSpoutBatchId id) {
  output.writeLong(id._id);
}

代码示例来源:origin: apache/hive

@Override
 public void write(Kryo kryo, Output output, java.sql.Date sqlDate) {
  output.writeLong(sqlDate.getTime());
 }
}

代码示例来源:origin: apache/storm

public void serialize(Output out) throws IOException {
    out.writeInt(_anchorsToIds.size(), true);
    for (Entry<Long, Long> anchorToId : _anchorsToIds.entrySet()) {
      out.writeLong(anchorToId.getKey());
      out.writeLong(anchorToId.getValue());
    }
  }
}

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

private static void writeNodeAddress(Output out, NodeAddress nodeAddress)
{
  if (nodeAddress != null)
  {
    UUID uuid = nodeAddress.asUUID();
    out.writeLong(uuid.getMostSignificantBits());
    out.writeLong(uuid.getLeastSignificantBits());
  }
  else
  {
    out.writeLong(0L);
    out.writeLong(0L);
  }
}

代码示例来源:origin: alibaba/jstorm

public void serialize(Output out) throws IOException {
  out.writeInt(_anchorsToIds.size(), true);
  for (Entry<Long, Long> anchorToId : _anchorsToIds.entrySet()) {
    out.writeLong(anchorToId.getKey());
    out.writeLong(anchorToId.getValue());
  }
}

代码示例来源:origin: apache/flink

@Override
public void write(Kryo kryo, Output output, TestClass testClass) {
  output.writeLong(42);
}

代码示例来源:origin: apache/hive

@Override
 public void write(Kryo kryo, Output output, Timestamp ts) {
  output.writeLong(ts.getTime());
  output.writeInt(ts.getNanos());
 }
}

代码示例来源:origin: alibaba/jstorm

@Override
  public void write(Kryo kryo, Output output, Pair inner) {
    output.writeLong(inner.getValue());
    output.writeString(inner.getKey());
  }
}

代码示例来源:origin: qiujiayu/AutoLoadCache

@Override
@SuppressWarnings("unchecked")
public void write(Kryo kryo, Output output, CacheWrapper object) {
  output.writeInt(object.getExpire(), true);
  output.writeLong(object.getLastLoadTime(), true);
  kryo.writeClassAndObject(output, object.getCacheObject());
}

代码示例来源:origin: alibaba/jstorm

@Override
public void write(Kryo kryo, Output output, TradeCustomer inner) {
  kryo.writeObject(output, inner.getCustomer());
  kryo.writeObject(output, inner.getTrade());
  output.writeLong(inner.getTimestamp());
  output.writeString(inner.getBuffer());
}

代码示例来源:origin: apache/hive

@Override
public void write(Kryo kryo, Output output, TimestampTZ object) {
 output.writeLong(object.getEpochSecond());
 output.writeInt(object.getNanos());
 output.writeString(object.getZonedDateTime().getZone().getId());
}

代码示例来源:origin: apache/tinkerpop

@Override
public void writeLong(final long l) {
  unshadedOutput.writeLong(l);
}

代码示例来源:origin: alibaba/jstorm

if (tuple instanceof TupleExt) {
  output.writeInt(((TupleExt) tuple).getTargetTaskId());
  output.writeLong(((TupleExt) tuple).getCreationTimeStamp());
  output.writeBoolean(((TupleExt) tuple).isBatchTuple());
  isBatchTuple = ((TupleExt) tuple).isBatchTuple();
    output.writeLong(((TupleExt) tuple).getBatchId(), true);

代码示例来源:origin: com.esotericsoftware/kryo

/** Writes a 1-9 byte double with reduced precision.
 * @param optimizePositive If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be
 *           inefficient (9 bytes). */
public int writeDouble (double value, double precision, boolean optimizePositive) throws KryoException {
  return writeLong((long)(value * precision), optimizePositive);
}

代码示例来源:origin: apache/metron

@Override
public void write(Kryo kryo, Output output) {
 //storing tdigest
 ByteBuffer outBuffer = ByteBuffer.allocate(digest.byteSize());
 digest.asBytes(outBuffer);
 byte[] tdigestSerialized = outBuffer.array();
 output.writeInt(tdigestSerialized.length);
 output.writeBytes(tdigestSerialized);
 output.writeLong(n);
 output.writeDouble(sum);
 output.writeDouble(sumOfSquares);
 output.writeDouble(sumOfLogs);
 output.writeDouble(getMin());
 output.writeDouble(getMax());
 output.writeDouble(M1);
 output.writeDouble(M2);
 output.writeDouble(M3);
 output.writeDouble(M4);
}

代码示例来源:origin: com.esotericsoftware/kryo

public void write (Output output, Object object) {
  try {
    if (varIntsEnabled)
      output.writeLong(field.getLong(object), false);
    else
      output.writeLong(field.getLong(object));
  } catch (Exception e) {
    KryoException ex = new KryoException(e);
    ex.addTrace(this + " (" + type.getName() + ")");
    throw ex;
  }
}

代码示例来源:origin: com.esotericsoftware/kryo

public void write (Kryo kryo, Output output, Calendar object) {
  timeZoneSerializer.write(kryo, output, object.getTimeZone()); // can't be null
  output.writeLong(object.getTimeInMillis(), true);
  output.writeBoolean(object.isLenient());
  output.writeInt(object.getFirstDayOfWeek(), true);
  output.writeInt(object.getMinimalDaysInFirstWeek(), true);
  if (object instanceof GregorianCalendar)
    output.writeLong(((GregorianCalendar)object).getGregorianChange().getTime(), false);
  else
    output.writeLong(DEFAULT_GREGORIAN_CUTOVER, false);
}

相关文章