read file to byte array method