Java Long Number Align alignSize(long size, long alignment)

Here you can find the source of alignSize(long size, long alignment)

Description

align Size

License

Open Source License

Declaration

static long alignSize(long size, long alignment) 

Method Source Code

//package com.java2s;

public class Main {
    static long alignSize(long size, long alignment) {
        if (alignment > 1) {
            long r = size % alignment;
            if (r != 0) {
                size += alignment - r;/*from w  w w  . j av  a2  s . c om*/
            }
        }
        return size;
    }
}

Related

  1. alignDown(long value, long granularity)
  2. alignLength(int sectorSize, long remoteOffset, long len)
  3. alignOffset(int sectorSize, long fileOffset)
  4. alignQueryTimestampToBaseAggregationTime(long queryTimestamp)
  5. alignSize(long size)
  6. alignUp(long b, long a)