Ejemplo n.º 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);
    }
Ejemplo n.º 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;
    }