Java Bit Unset unsetBit(long flags, long bit)

Here you can find the source of unsetBit(long flags, long bit)

Description

Unset a bit or bit combination from bitmap

License

Open Source License

Parameter

Parameter Description
flags bitmap to change
bit bits to unset

Return

updated bitmap with specified bits cleared

Declaration

public static long unsetBit(long flags, long bit) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//w w  w  .  java  2s .  c  om
     * Unset a bit or bit combination from bitmap
     * @param flags  bitmap to change
     * @param bit bits to unset
     * @return updated bitmap with specified bits cleared
     */
    public static long unsetBit(long flags, long bit) {
        return flags & ~bit;
    }

    /**
     * Unset a bit or bit combination from bitmap
     * @param flags  bitmap to change
     * @param bit bits to unset
     * @return updated bitmap with specified bits cleared
     */
    public static int unsetBit(int flags, int bit) {
        return flags & ~bit;
    }
}

Related

  1. unsetBit(byte original, int bitToUnSet)
  2. unsetBit(byte[] b, int index)
  3. unsetBit(int f, int i)
  4. unSetBit(int integer, int bit)
  5. unsetBit(int value, int flags)
  6. unsetFlag(final int data, final int flag)
  7. unsetFlag(int bitset, int flag)
  8. unsetHighBit(int integer)