// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.*;
import java.net.*;

public class Client {
   public static void main(String[] args) throws Exception {
      Socket s = new Socket("localhost", 9999);
      OutputStream os = s.getOutputStream();
      InputStream is = new FileInputStream("C:\\z1.zip");
      byte[] b = new byte[10000];
      int n;
      while((n = is.read(b)) >= 0) {
         os.write(b, 0, n);
      }
      os.close();
      is.close();
   }
}
