When you are reading bytes which don't represent text -- like those encrypted bytes you have at the back end of that file there -- don't use a Reader to read them. Use an InputStream instead, exactly like you did in the first program.
Thanks you.
My goal is split file, i can't write method ReadFile(String filename) that return byte[] (can you help me ???), then how i can split file form that array byte ??
I don't see why you need a ReadFile method which returns an array of bytes. If I understand it correctly, your mushed-together file consists of one set of data, then an "@", then another set of data. So read bytes until you hit the @, and write all of those bytes (except the @) into the first file. Then copy the rest of the bytes into the second file. Sort of like your first program.
By the way, why did you decide to do this? Mashing two kinds of data into a single file is rarely a good idea. I wouldn't do that if I had to store the text and the encrypted data, I would just store them in two separate files. And not only because it's hard to write a program to split the two, also because you now need a rule which says you can't have the "@" character in the text half of the file.
Thanks you a lot of
I merge file because i 'm doing about digital signature. i need encrypt file root document and file digital signature then i ecrypt them by public key of receiver. Do you have idea for me ??? Thanks