Here you can find the source of setBits(long value, long bits)
Parameter | Description |
---|---|
value | the value. |
bits | the bits to set. |
public static long setBits(long value, long bits)
//package com.java2s; /******************************************************************************* * Copyright (c) 2009-2016 Black Rook Software * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v2.1 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html ******************************************************************************/ public class Main { /**//from w w w .j a va2 s . c om * Sets the bits of a value. * @param value the value. * @param bits the bits to set. * @return the resulting number. */ public static long setBits(long value, long bits) { return value | bits; } /** * Sets the bits of a value. * @param value the value. * @param bits the bits to set. * @return the resulting number. */ public static int setBits(int value, int bits) { return value | bits; } }