Java Long Number Align alignSize(long size)

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

Description

align Size

License

Apache License

Declaration

protected static final long alignSize(long size) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /** The number of bytes used to represent an object (with no fields). */
    public static final int SIZE_OF_OBJECT_INSTANCE = 8;

    protected static final long alignSize(long size) {
        long i = size % SIZE_OF_OBJECT_INSTANCE;
        if (i == 0) {
            return size;
        }//from w  w  w .  j  a va 2  s . c  o m
        return size + SIZE_OF_OBJECT_INSTANCE - i;
    }
}

Related

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