After transfer. The file contents in the destination machine is getting
changed.
Please Help.
Please advice if i am doing any wrong. The number of bytes getting transfered
is correct. only some of the bytes in the file (in the destination machine)
are different.
I dont know why is this happening.
I have appened code segment.
{
Socket ds = new Socket(serverName, dataPort);
if ( f.sendCommand("type I" + f.eol, true) ) {
System.out.println("Main: bi");
System.out.println("bi results: " + f.cmdResponse );
String filePath="C:\\sri.bin";
int line = 0;
File f = new File(filePath);
FileInputStream srcFile = new FileInputStream(f);
BufferedInputStream bufFile = new BufferedInputStream(srcFile);
DataInputStream inData = new DataInputStream(bufFile);
OUT = new PrintWriter( ds.getOutputStream(), true );
OUT.write("TYPE I"); /* setting transfer mode = BINARY */
while ((line=inData.read()) != -1 ){
OUT.write(line);
}
OUT.flush();
OUT.close() ;
}
Regards,
Ram