How to convert from your Class object to byte[] and vice versa and send it through Sockets I’ve moved this post to my new blog. http://fpgentil.github.io/2012/how-to-convert-from-your-class-object-to-byte-and-vice-versa-and-send-it-through-sockets/