while (true) { currentLine = in.readLine(); if (currentLine != null) { if (currentLine.charAt(0) != '-') { out.write(currentLine + '\n'); out.flush(); } else { processPlayerTrackOutput(currentLine); out.flush(); } } }
while ((currentLine=in.readLine()) != null) { if (currentLine.charAt(0) != '-') { out.write(currentLine + '\n'); out.flush(); } else { processPlayerTrackOutput(currentLine); out.flush(); } }
   public void route(final InputStream is, final OutputStream os, String title) {    new Thread(title) {      public void run() {        String currentLine;                try {          BufferedReader in = new BufferedReader(new InputStreamReader(is));          BufferedWriter out = new BufferedWriter(new OutputStreamWriter(os));                    while (true) {            currentLine = in.readLine();            if (currentLine != null) {              if (currentLine.charAt(0) != '-') {                out.write(currentLine + '\n');                out.flush();              }              else {                processPlayerTrackOutput(currentLine);                out.flush();              }            }           }        }         catch (IOException ioe) {          //ioe.printStackTrace();        }      }    }.start();  }