public int readBlob(String blobId, long pos, byte[] buff, int off,
int length) throws Exception {
GridFSDBFile f = fs.findOne(new ObjectId(blobId));
if (f == null) {
throw new NotFoundException(blobId);
}
// todo provide a more efficient implementation (gridfs stores the data in chunks)
//long nChunk = pos / f.getChunkSize();
InputStream in = f.getInputStream();
try {