Yesenfei

while ((line = reader.readLine()) != null) 
otherwise you will add the last null-line into result.