The TCP protocol contains checksums and retransmit machanisms to make sure your data doesn't get corrupted on the way. If a package is damaged (i.e. the checksum doesn't match on the receiving end), the TCP/IP stack will automatically ask the server to send this frame again.
There is no need to do anything at the Socket or Java application layer.