我想从Enumerator[Array[Byte]]获取Array/List[Byte]。一些文章向我展示了如何在playframework中实现它。但我并没有在这个项目中使用游戏框架。这就是我所拥有的:
lazy val gridfs = GridFS[BSONSerializationPack.type](db, "resource")
gridfs.find(BSONDocument("_id" -> BSONObjectID(id))).headOption.map{
case Some(file) => {
//this gives me Enumerator[Array[Byte]].
//I'm not using playframework, how to get Future[Array[Byte]] from here?
gridfs.enumerate(file)
}
}