Here you can find the source of setBit(int position, boolean value, int meta)
public static int setBit(int position, boolean value, int meta)
//package com.java2s; //License from project: Open Source License public class Main { public static int setBit(int position, boolean value, int meta) { if (value) { return meta | (1 << position); }/*from ww w . j a v a 2 s . c om*/ return meta & ~(1 << position); } }