Reem aa wrote:Thanks A lot for your help,
OK how I can read .dat file?
because I read .dat file ...
Reading the binary file is simple -- just use the java io library to read the binary data directly into a byte array.
Reem aa wrote:then store in String after that pass as string
As others have already mentioned ... This is the part that breaks. Encrypted data can't be stored into a string (unless you happen to get real lucky and run into a case that does). So, this means that the code that you shown so far is broken. It is not possible to create a string that can be converted back to encrypted data for most of the cases.
In other words, it doesn't matter what you do to convert the string to be passed to the method, the method won't work regardless of what you pass. You need to fix the method before you can worry about passing data to it. Either convert the method to use a byte array instead, or (if you really want to only use a string) convert the method to use a string that is holding encoded data.
Henry