Java Boolean to Byte booleanToByte(boolean[] array)

Here you can find the source of booleanToByte(boolean[] array)

Description

boolean To Byte

License

Open Source License

Declaration

public static byte booleanToByte(boolean[] array) 

Method Source Code

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

public class Main {
    public static byte booleanToByte(boolean[] array) {
        byte val = 0;
        for (boolean b : array) {
            val <<= 1;
            if (b)
                val |= 1;
        }//from  w  ww  . ja v  a  2  s  .c  o  m
        return val;
    }
}

Related

  1. booleanToByte(boolean b)
  2. BooleanToByte(boolean value)
  3. booleanToByte(boolean x)
  4. booleanToByte(boolean[] bool)
  5. booleanToByte(boolean[] values)
  6. booleanTobyte(final boolean value)
  7. booleanToByteBitflags(boolean[] flags)