@Override public int fastReadFrom(byte[] iStream, int pos, ORecordVersion version) { final ODistributedVersion distributedVersion = (ODistributedVersion) version; int len = 0; distributedVersion.counter = CONVERTER.getInt(iStream, pos + len); len += OBinaryProtocol.SIZE_INT; distributedVersion.timestamp = CONVERTER.getLong(iStream, pos + len); len += OBinaryProtocol.SIZE_LONG; distributedVersion.macAddress = CONVERTER.getLong(iStream, pos + len); len += OBinaryProtocol.SIZE_LONG; return len; }
@Override public int fastWriteTo(byte[] iStream, int pos, ORecordVersion version) { final ODistributedVersion distributedVersion = (ODistributedVersion) version; int len = 0; CONVERTER.putInt(iStream, pos + len, distributedVersion.counter); len += OBinaryProtocol.SIZE_INT; CONVERTER.putLong(iStream, pos + len, distributedVersion.timestamp); len += OBinaryProtocol.SIZE_LONG; CONVERTER.putLong(iStream, pos + len, distributedVersion.macAddress); len += OBinaryProtocol.SIZE_LONG; return len; }
public Double deserializeNative(byte[] stream, int startPosition) { return Double.longBitsToDouble( CONVERTER.getLong(stream, startPosition, ByteOrder.nativeOrder())); }
public void serializeNative(Double object, byte[] stream, int startPosition) { CONVERTER.putLong( stream, startPosition, Double.doubleToLongBits(object), ByteOrder.nativeOrder()); }