示例#1
0
    @Override
    public void writeTo(OutputStream stream, ORecordVersion version) throws IOException {
      final ODistributedVersion distributedVersion = (ODistributedVersion) version;

      OBinaryProtocol.int2bytes(distributedVersion.counter, stream);
      OBinaryProtocol.long2bytes(distributedVersion.timestamp, stream);
      OBinaryProtocol.long2bytes(distributedVersion.macAddress, stream);
    }
示例#2
0
    @Override
    public int writeTo(byte[] stream, int pos, ORecordVersion version) {
      final ODistributedVersion distributedVersion = (ODistributedVersion) version;

      int len = 0;
      OBinaryProtocol.int2bytes(distributedVersion.counter, stream, pos + len);
      len += OBinaryProtocol.SIZE_INT;
      OBinaryProtocol.long2bytes(distributedVersion.timestamp, stream, pos + len);
      len += OBinaryProtocol.SIZE_LONG;
      OBinaryProtocol.long2bytes(distributedVersion.macAddress, stream, pos + len);
      len += OBinaryProtocol.SIZE_LONG;

      return len;
    }