All right, now i can be a bit more specific.
We are able to transfer ascii files back and forth (xml, file lengths, things like that) but whenever we attempt to transfer a binary file such as an executable, there are corruption issues, and the process fails. Here is some of the code that I am using on my side. This takes place in a thread which receives the socket attribute when constructed.
DataInputStream in = new DataInputStream(socket.getInputStream());
byte[] array = new byte[11]; // 11 is the constant used to receive the file size
in.read(array);
fileString = new String(array);
fileString = fileString.trim(); // remove any whitespace (in particular an \0 which indicates the end of a transfer.
int fileLength = Integer.parseInt(fileString);
array = new byte[fileLength];
in.read(array);
if(verifyFile(tempItem.getMD5Hash(), array) {
conn.add(blah blah blah...)
verifyItem is an md5 checking function which returns a boolean.
The data other than the file itself is received as an XML file before each associated file is transmitted. The XML file provides an expected md5, the name of the file, it's index in the database, and of course the total number of files to be transmitted.
If there's any other information I can provide you with, please let me know.
Bob