Java Bit Value Set bitIsSet(byte data, byte bit)

Here you can find the source of bitIsSet(byte data, byte bit)

Description

bit Is Set

License

Open Source License

Declaration

public static boolean bitIsSet(byte data, byte bit) 

Method Source Code

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

public class Main {
    public static boolean bitIsSet(byte data, byte bit) {
        return getBitValue(data, bit) != 0;
    }/*from www  .  ja  va2s.  c om*/

    public static int getBitValue(byte data, byte bit) {
        return (data & (1 << bit)) > 0 ? 1 : 0;
    }
}

Related

  1. bit_marker(String attribute, String type, int maxBits, int bit, boolean on)
  2. bit_marker_flexint(String attribute, int bit, boolean on)
  3. bit_marker_geohash(String attribute, int bit, boolean on)
  4. bitIsSet(int i, int offset)
  5. bitIsSet(int x, int pos)
  6. bitIsSet(long value, long test)
  7. bitSet(byte b, int pos)