Java Bit Mask bitMask(int bitSize)

Here you can find the source of bitMask(int bitSize)

Description

bit Mask

License

Mozilla Public License

Declaration

public static int bitMask(int bitSize) 

Method Source Code

//package com.java2s;
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

public class Main {
    protected static final int SZ_INT = 32;

    public static int bitMask(int bitSize) {

        return (0xFFFFFFFF >>> (SZ_INT - bitSize));
    }//from w w  w.ja v  a  2s  .  c o  m
}

Related

  1. bitMask(final int numberOfBits)
  2. bitMask(int bit)
  3. bitMask(int i)