harke baj wrote:
Now I want to separate byte[] ab to recover the String a and String b;
Well, since the ab byte array doesn't retain any information pertaining to the size of strings a and b, there is no way to determine how many bytes goes to which string.
However, if you can obtain the info, then the easiest option is to create new byte arrays a and b, using the size info, and using System.arraycopy() method to copy the bytes.
Henry