Here you can find the source of ShiftLeftOne(int[] arr)
static int ShiftLeftOne(int[] arr)
//package com.java2s; public class Main { static int ShiftLeftOne(int[] arr) { {//from ww w. ja va 2 s . c om int carry = 0; for (int i = 0; i < arr.length; ++i) { int item = arr[i]; arr[i] = (int) (arr[i] << 1) | (int) carry; carry = ((item >> 31) != 0) ? 1 : 0; } return carry; } } }