add method to javawrapper to retrieve byte array