sToXiC 0 Newbie Poster

Hello,

I am working on a server-client app but I am facing a problem.

The problem is that I don't know how to do unmarshalling properly. As an example. The client sends a request to obtain alist of existing blog records from the server. The server connects to the DB, retrieves all the information and send it back to the client. Then I get the response at the client. I try to unmarshall the data but I don't know how the unmarshalling will "cut" each string properly.
Lets say, 2 strings, user and title. On one case the length of each string might be 6, 13. In that way I will use :

String user_text = new String(received_bytes, 0, 5, "US-ASCII"); and String title_text = new String(received_bytes, 6, received_bytes.length, "US-ASCII");

What if now in the next entry the strings' length are 7 and 18?

I know that the solution might be very simple...
Any help would be appreciated.