// Get set up to read lines of text from the user
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for(;;) { // Loop forever
System.out.print("> "); // Print a prompt
String line = in.readLine(); // Read a line
if ((line == null) || line.equals("quit")) // If EOF or "quit" then...
break; // ... break out of the loop
StringBuffer buf = new StringBuffer(line); // Convert to a StringBuffer
for(int i = 0; i < buf.length(); i++) // For each character...
buf.setCharAt(i, rot13(buf.charAt(i))); // read, encode, put it back
System.out.println(buf); // Print encoded line
}