package org.flatland.drip;
import java.lang.reflect.Method;
import java.io.*;

public class Main {
  public static void main(String[] args) throws Exception {
    String class_name = args[0];
    String fifo_dir   = args[1];

    reopenStreams(fifo_dir);
    Method main = mainMethod(class_name);

    Method init       = mainMethod(System.getenv("DRIP_INIT_CLASS"));
    String init_args  = System.getenv("DRIP_INIT");
    if (init_args != null) mainInvoke(init == null ? main : init, init_args);

    mainInvoke(main, readline());
    System.exit(0);
  }

  private static Method mainMethod(String class_name)
    throws ClassNotFoundException, NoSuchMethodException {
    if (class_name != null) {
      return Class.forName(class_name).getMethod("main", String[].class);
    } else {
      return null;
    }
  }

  public static void mainInvoke(Method main, String argstring) throws Exception {
    String [] args = argstring.trim().split("\t");
    if (args.length == 1 && args[0].equals("")) {
      args = null;
    }
    main.invoke(null, (Object) args);
  }

  public static void reopenStreams(String fifo_dir) throws FileNotFoundException, IOException {
    System.in.close();
    System.out.close();
    System.err.close();
    System.setIn(new BufferedInputStream(new DelayedFileInputStream(fifo_dir + "/in")));
    System.setOut(new PrintStream(new DelayedFileOutputStream(fifo_dir + "/out")));
    System.setErr(new PrintStream(new DelayedFileOutputStream(fifo_dir + "/err")));
  }

  public static String readline() throws IOException {
    StringBuffer s = new StringBuffer();

    while (true) {
      char c = (char) System.in.read();
      if (c == '\n' || c == -1) break;
      s.append(c);
    }
    return s.toString();
  }
}

@@ -70,16 +70,71 @@
 va.io.*;
+%0Aimport java.util.Scanner;%0Aimport java.util.LinkedList;
 %0A%0Apublic
@@ -957,99 +957,146 @@
    S
-tring %5B%5D args = argstring.trim().split(%22%5Ct%22);%0A    if (args.length == 1 && args%5B0%5D.equals(%22%22
+canner s = new Scanner(argstring);%0A    s.useDelimiter(%22%5Ct%22);%0A    LinkedList%3CString%3E args = new LinkedList%3CString%3E();%0A    while (s.hasNext(
 )) %7B
@@ -1110,15 +1110,22 @@
 args
- = null
+.add(s.next())
 ;%0A  
@@ -1158,21 +1158,43 @@
 (Object)
- 
 args
+.toArray(new String%5B0%5D)
 );%0A  %7D%0A%0A
@@ -1682,25 +1682,20 @@
  %7B%0A    S
-tringBuff
+cann
 er s = n
@@ -1702,87 +1702,85 @@
 ew S
-tringBuffer(
+canner(System.in
 );%0A
-%0A
     
-while (true) %7B%0A      char c = (char) System.in.read
+if (s.hasNextLine()) %7B%0A      return s.nextLine
 ();%0A    
   if
@@ -1779,92 +1779,39 @@
     
-  
-if (c == '%5Cn' %7C%7C c == -1) break;%0A      s.append(c);%0A    %7D%0A    return s.toString();
+%7D else %7B%0A      return %22%22;%0A    %7D
 %0A  %7D

Use j.u.Scanner instead of rolling our own parser