Here you can find the source of setBit(byte target, byte pos)
private static byte setBit(byte target, byte pos)
//package com.java2s; //License from project: Open Source License public class Main { private static byte setBit(byte target, byte pos) { return target |= (1 << pos); }/*from w w w . j a v a2s . c o m*/ }