Client Server Program String leak?
<p>My Server Program:-</p>

<pre><code>import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

import javax.print.PrintService;
import javax.print.PrintServiceLookup;


public class GetFileServeredit implements Runnable {

    public static final int SERVERPORT = 4747;
    public String FileName=null; 
    public void run() {
        try {
            ServerSocket svr=new ServerSocket(SERVERPORT);
            while(true){
                System.out.println("S: Waiting...");

                Socket sktClient=svr.accept();
                System.out.println("S: Receiving...");
                try{

                    PrintService services[] = PrintServiceLookup.lookupPrintServices(null, null);

                    PrintWriter out2 = new PrintWriter(new BufferedWriter(new OutputStreamWriter(sktClient.getOutputStream())),true);

                    /*for(int z=0;z&lt;services.length;z++){

                        out2.println(services[z]);

                    }*/
                    out2.println("aaa 12212");
                    out2.flush();
                    out2.close();

                    sktClient.close();

                    System.out.println("Transfer complete.");


                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }

        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }   

    public static void main(String [] args){

        Thread servThread =new Thread(new GetFileServeredit());
        servThread.start();
    }
}
</code></pre>

<p>My Client Program
:-</p>

<pre><code>import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.ArrayList;


public class ClientPrinters implements Runnable {
    static final int PORT = 4747; //Change this to the relevant port
    static final String HOST = "192.***.*.***"; //Change this to the relevant HOST,//(where Server.java is running)

    public void run() {

        try {
            System.out.print("Sending data...\n");
            Socket skt = new Socket(HOST, PORT);        

            ArrayList Printers =new ArrayList();
            InputStream inStream = skt.getInputStream();
            BufferedReader inm = new BufferedReader(new InputStreamReader(inStream));


            while ((inm.read()) != -1) {
                Printers.add(inm.readLine());
            }


            inm.close();
            inStream.close();
            skt.close();

            }
        catch( Exception e ) {          
            System.out.print("Error! It didn't work! " + e + "\n");
        }
    }

    public static void main(String [] args){

        Thread cThread =new Thread(new ClientPrinters());
        cThread.start();
    }
}
</code></pre>

<p>The out that i am sending form the server i.e </p>

<pre><code>out2.println("aaa 12212");
</code></pre>

<p>becomes 12212 only at the client side,why? where is the other text??</p>
