Implemented a wrapper method to accept byte stream of a image