List of utility methods to do Long Number Align
long | align(final long value, final long alignment) align return (value + (alignment - 1)) & ~(alignment - 1);
|
long | align(long size, long boundary) align return (size + boundary - 1) & ~(boundary - 1);
|
long | align(long value, int al) align int rest = (int) (value % (long) al); return value - rest; |
long | align(long value, long alignment) align return divideAndRoundUp(value, alignment) * alignment;
|
long | alignDown(long value, long granularity) align Down return (value / granularity) * granularity;
|
long | alignLength(int sectorSize, long remoteOffset, long len) align Length long alignedSize = len + namespaceSectorOffset(sectorSize, remoteOffset); if (namespaceSectorOffset(sectorSize, alignedSize) != 0) { alignedSize += (long) sectorSize - namespaceSectorOffset(sectorSize, alignedSize); return alignedSize; |
long | alignOffset(int sectorSize, long fileOffset) align Offset return fileOffset - namespaceSectorOffset(sectorSize, fileOffset);
|
long | alignQueryTimestampToBaseAggregationTime(long queryTimestamp) align Query Timestamp To Base Aggregation Time if (isBaseAggregationTimestamp(queryTimestamp)) { return queryTimestamp; } else { return queryTimestamp - queryTimestamp % AGGREGATION_TIME_INTERVAL; |
long | alignSize(long size) align Size long i = size % SIZE_OF_OBJECT_INSTANCE; if (i == 0) { return size; return size + SIZE_OF_OBJECT_INSTANCE - i; |
long | alignSize(long size, long alignment) align Size if (alignment > 1) { long r = size % alignment; if (r != 0) { size += alignment - r; return size; |