ByteArrayOutputStream bStream = null; ObjectOutputStream oStream = null; GridFSInputFile inputFile = null; bStream = new ByteArrayOutputStream(); oStream = new ObjectOutputStream(bStream); //Have the objectoutputstream get the serializable object oStream.writeObject(revision.getContent()); inputFile = myFS.createFile(bStream.toByteArray()); //set meta data for GridFS object so it's easy to query on inputFile.put("contentId", revision.getContentId()); inputFile.put("contentTypeId", revision.getContentTypeId()); inputFile.put("siteId", revision.getSiteId()); inputFile.put("_id", revision.getId()); inputFile.save();