Java Integer Align align(int size)

Here you can find the source of align(int size)

Description

Align |size| on BindingsHelper#ALIGNMENT .

License

Open Source License

Declaration

public static int align(int size) 

Method Source Code

//package com.java2s;
// Use of this source code is governed by a BSD-style license that can be

public class Main {
    /**//from  www  . j a  va  2  s .co m
     * Alignment in bytes for mojo serialization.
     */
    public static final int ALIGNMENT = 8;

    /**
     * Align |size| on {@link BindingsHelper#ALIGNMENT}.
     */
    public static int align(int size) {
        return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
    }

    /**
     * Align |size| on {@link BindingsHelper#ALIGNMENT}.
     */
    public static long align(long size) {
        return (size + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
    }
}

Related

  1. align(int addr, int align)
  2. align(int cur, int longest)
  3. align(int i)
  4. align(int min, int number, int max)
  5. align(int pos, int align)
  6. align(int size, int align)
  7. align(int size, int alignment)
  8. align(int size, int space, int weight)
  9. align(int value, int alignment)