Using the Java driver, you can simply store a byte array and the driver will convert it to the BSON binary type. This is discussed a bit in the
Java Types documentation, as well as
this mailing list thread. As Eoin mentioned above, if you are storing large binary blobs (exceeding the 16MB document limit), you will need to look into using the
GridFS API, which is documented
here for the Java driver.