If you wanna do it on your own, you should create an object out of it. It´s easyer to handle afterwards.
After that you serialize it, then you split it in smaller byte (if it´s bigger then 64 kb).
You add some bytes to each packet, I prefere
byte = is splited?
byte + byte = sendNumber (just for controlling, it increases after every sent object)
byte = how many parts your object has
byte = what part is it
...What you need else.
Afterwards you can easily put the parts together and if some parts are lost, you can order them from the server again.
best regs. phib
EDIT: Got a better solution:http://www.java-gaming.org/topics/network-infrastructure/27051/msg/241326/view.html#msg241326