1. Both your print statements just print a new line. Neither of them print anything else - I assume either the number or a message is supposed to be written?
2. You ought to close your PrintStreams. That's probably not the cause, but in some cases the stuff you print might be "buffered", and never get written if you never close the stream. It could lead to other problems as well. If you're using Java 7 the easiest way is to use a try-with-resources statement, which can automatically close resources for you. If you aren't, you should create the streams in a try block, and close them in a finally block. (If you haven't come across these, http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html is probably a good starting point).