Пример #1
0
  public void run() {
    try {
      System.out.println("socked");
      sock = new Socket(ii, pp);
      oout = new ObjectOutputStream(sock.getOutputStream());
      oout.flush();

      oin = new ObjectInputStream(sock.getInputStream());
      System.out.println("read ");
      rf.setLength(0);
      do {
        System.out.println("read ");
        file f = (file) oin.readObject();
        if (f.length <= 0) break;
        write(f);
      } while (true);
      oout.close();
      oin.close();
      rf.close();
      sock.close();
      xx.ConfirmPopup("Haua file namano shesh!!!");

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Пример #2
0
  public void process() throws Exception {
    oout = new ObjectOutputStream(sock.getOutputStream());
    oout.flush();
    oin = new ObjectInputStream(sock.getInputStream());
    byte ary[] = new byte[1024 * 100];
    int tmp;
    int i = 0;
    do {
      tmp = getBytes(ary, i);
      if (tmp <= 0) break;
      file x = new file(i, tmp, ary);
      i += tmp;
      send(x);
    } while (true);

    oout.writeObject(new file(0, 0, ary));
    oout.flush();
    oout.close();
    oin.close();
    rf.close();
    sock.close();
    xx.ConfirmPopup("Vai file ta gesega.. Amar kam shesh");
  }