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[0] = is splited?
byte[1] + byte[2] = sendNumber (just for controlling, it increases after every sent object)
byte[3] = how many parts your object has
byte[4] = 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