A comment on your code:
NEVER have an empty catch clause. Add at lease a e.printStackTrace() to it

Add a println to show the value of tmp following each read.