The read(byte) command will try to read 10 bytes at once (because your byte is 10 bytes). It will try to read those 10 bytes and when the inputstream is at it's end it will return -1. If less then 10 bytes can be read the read method will return the amount that can be read.
So if you follow these rules you can see why your output can be unpredictable.
You'd better do something like this:
Joined: Aug 29, 2005
Instead of reading character by character, consider using bufferedReader to read the whole line.