gpt4 book ai didi

io.jenetics.jpx.ZonedDateTimes.read()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:55:09 33 4
gpt4 key购买 nike

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

ZonedDateTimes.read介绍

暂无

代码示例

代码示例来源:origin: jenetics/jpx

@Test
public void readWriteZonedDateTime() throws IOException {
  final Random random = new Random();
  for (int i = 0; i < 1000; ++i) {
    final ZonedDateTime zdt = nextZonedDataTime(random);
    final ByteArrayOutputStream bout = new ByteArrayOutputStream();
    final DataOutputStream dout = new DataOutputStream(bout);
    ZonedDateTimes.write(zdt, dout);
    final ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
    final DataInputStream din = new DataInputStream(bin);
    final ZonedDateTime read = ZonedDateTimes.read(din);
    Assert.assertEquals(read, zdt);
  }
}

代码示例来源:origin: jenetics/jpx

static WayPoint read(final DataInput in) throws IOException {
  final int existing = in.readInt();
  return new WayPoint(
    Latitude.ofDegrees(in.readDouble()),
    Longitude.ofDegrees(in.readDouble()),
    ((existing & (1 <<  0)) != 0) ? Length.read(in) : null,
    ((existing & (1 <<  1)) != 0) ? Speed.read(in) : null,
    ((existing & (1 <<  2)) != 0) ? ZonedDateTimes.read(in) : null,
    ((existing & (1 <<  3)) != 0) ? Degrees.read(in) : null,
    ((existing & (1 <<  4)) != 0) ? Length.read(in) : null,
    ((existing & (1 <<  5)) != 0) ? IO.readString(in) : null,
    ((existing & (1 <<  6)) != 0) ? IO.readString(in) : null,
    ((existing & (1 <<  7)) != 0) ? IO.readString(in) : null,
    ((existing & (1 <<  8)) != 0) ? IO.readString(in) : null,
    ((existing & (1 <<  9)) != 0) ? IO.reads(Link::read, in) : null,
    ((existing & (1 << 10)) != 0) ? IO.readString(in) : null,
    ((existing & (1 << 11)) != 0) ? IO.readString(in) : null,
    ((existing & (1 << 12)) != 0) ? Fix.valueOf(IO.readString(in)) : null,
    ((existing & (1 << 13)) != 0) ? UInt.read(in) : null,
    ((existing & (1 << 14)) != 0) ? in.readDouble() : null,
    ((existing & (1 << 15)) != 0) ? in.readDouble() : null,
    ((existing & (1 << 16)) != 0) ? in.readDouble() : null,
    ((existing & (1 << 17)) != 0) ? Duration.ofMillis(in.readLong()) : null,
    ((existing & (1 << 18)) != 0) ? DGPSStation.read(in) : null,
    ((existing & (1 << 19)) != 0) ? Degrees.read(in) : null
  );
}

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com