download file from database

Hello, I am trying to download a pdf file from database. The coding did download some content, but these downloaded file's size appear to be smaller than it should be, comparing to blob in database. Original file size is 40kb but downloaded file size is 39kb as such. Below is what I've done. Can someone please tell me what did I do wrong?