Here you can find the source of bitMask(int bitSize)
public static int bitMask(int bitSize)
//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 }