import client.*; import java.io.*; public class CopyOut { public static void main(String[] args) { try { System.out.println("Opening remote file ..."); RemoteInputStream ris = new RemoteInputStream(args[0]); System.out.println("Opening local file ..."); FileOutputStream los = new FileOutputStream(args[0]); final int MAXBUF = 1024; byte [] buffer = new byte[MAXBUF]; System.out.print("Copying ."); System.out.flush(); int letti = ris.read(buffer, 0, MAXBUF); while(letti > 0) { System.out.print(".");System.out.flush(); los.write(buffer, 0, letti); letti = ris.read(buffer, 0, MAXBUF); } System.out.println("\nClosing remote file"); ris.close(); System.out.println("Closing local file"); los.close(); } catch (Exception e) { e.printStackTrace(); return; } } }