// 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"...
break; // ...break out of loop
StringBuffer buf = new StringBuffer(line); // Use a StringBuffer
for(int i = 0; i < buf.length(); i++) // For each character...
buf.setCharAt(i, rot13(buf.charAt(i)));// ..read, encode, store
System.out.println(buf); // Print encoded line
}