I got this working, as given in Converting string of bytes to integer - #4 by SudhakarKuma.
Thanks, @Benny.