Partial implementation of bitArrayToByte