class ByteArrayHelper {

  public static boolean getBit(byte[] input, int index) {
    if (index < 0) {
      throw new IllegalAccessError("Bit index must not be negative.");
    }
    byte currentByte = (byte) (input[index / 8] >> (7 - (index % 8)));
    boolean choiceBit = false;
    if ((currentByte & 1) == 1) {
      choiceBit = true;
    }
    return choiceBit;
  }

  private  ByteArrayHelper();

}