use buffered input stream instead of buffered reader