I am uploading a PDF to MongoDB using JAVA. On downloading the same file from MongoDB using java the PDF gets corrupted.
For uploading, I am using following code :