public void send(String mesaj, boolean isFile)
    {
        try {
            stream = new DataOutputStream(s.getOutputStream());
        } catch (IOException ex) {
            System.out.println("Streamul nu poate fi creat");
        }
        try {
            if (!isFile) stream.writeUTF("/msg "+nume1+" "+mesaj);
            else 
            {
                String fisier=mesaj;
                stream.writeUTF("/transfer "+nume1+" "+fisier);
                InputStream fis = null;
                try { fis = new FileInputStream(fisier); }
                catch (FileNotFoundException e) {
                  System.out.println("Fisier inexistent");
                }
                int p = fisier.lastIndexOf("\\");
                fisier = fisier.substring(p+1,fisier.length());
                int k;
                while( (k=fis.read()) != -1) stream.write(k);
                stream.write(0);
                fis.close(); System.out.println("Fisier transmis!");
                }
        } catch (IOException ex) {
            System.out.println("textul nu poate fi scris");
            return;
        }
        if (!isFile) jTextArea1.setText(jTextArea1.getText()+"[eu]:"+mesaj+"\n");
        if (jTextField1.getText().equals("/quit"))
        {
            Input.ok=false;
            try {
                s.close();
            } catch (IOException ex) {
               System.out.println("Socketul nu poate fi inchis");
               return;
            }
        }
        jTextField1.setText("");
    }