Microsoft Visual J++. Java


- 2


//

DataOutputStream os = new DataOutputStream(

new BufferedOutputStream(

new FileOutputStream("output.dat")));

 

// ,

// u,

while(true)

{

int nReaded = is.read(buf);

if(nReaded == -1)

break;

 

os.write(buf, 0, nReaded);

}

 

//

is.close();

os.close();

 

System.out.println("File received");

}

catch(Exception ioe)

{

System.out.println(ioe.toString());

}

 

try

{

System.out.println("Press <Enter> to terminate...");

System.in.read(bKbdInput);

}

catch(Exception ioe)

{

System.out.println(ioe.toString());

}

}

}