Strumenti Utente

Strumenti Sito


lpr-b:codicescrittore
no way to compare when less than two revisions

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.


lpr-b:codicescrittore [04/02/2008 alle 14:17 (18 anni fa)] (versione attuale) – creata Marco Danelutto
Linea 1: Linea 1:
 +<code lang=java>
 +import java.io.*;
 +import client.*;
  
 +public class CopyIn {
 +
 +        public static void main(String[] args) {
 +                try {
 +                        System.out.println("Opening remote file ...");
 +                        RemoteOutputStream ros = new RemoteOutputStream(args[0],Boolean.parseBo
 +olean(args[1]));
 +                        System.out.println("Opening local file ...");
 +                        FileInputStream        is  = new FileInputStream(args[0]);
 +                        final int MAXBUF = 1024; 
 +                        byte [] buffer = new byte[MAXBUF];
 +                        System.out.print("Copying ."); System.out.flush();
 +                        int letti = is.read(buffer, 0, MAXBUF);
 +                        while(letti > 0) {
 +                                System.out.print(".");System.out.flush();
 +                                ros.write(buffer, 0, letti);
 +                                letti = is.read(buffer, 0, MAXBUF);
 +                        }
 +                        System.out.println("\nClosing remote file");
 +                        ros.close();
 +                        System.out.println("Closing local file");
 +                        is.close();
 +                } catch (Exception e) {
 +                        e.printStackTrace();
 +                        return;
 +                }
 +        }
 +
 +}
 +
 +</code>
lpr-b/codicescrittore.txt · Ultima modifica: 04/02/2008 alle 14:17 (18 anni fa) da Marco Danelutto

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki