Hybris MediaModel how to get Bytes
问题 Is there any way in Hybris to obtain all the bytes from a MediaModel ? When I want to instantiate a PdfReader , I need to pass either the Path of the File OR the ByteArrayInputStream. How can I transform the MediaModel into a Byte Array? 回答1: You can use MediaService @Resource private MediaService mediaService; //... final MediaModel mediaModel= mediaService.getMedia("mediaName"); final InputStream inputStream = mediaService.getStreamFromMedia(mediaModel); Then you can pass InputStream or