I am not getting what I am doing wrong. The same xyz.jpg file I am encoded to byte string. Now when I try to convert jpg file from the same byte string, I am getting error.