Added a getdata function to return a clone of binary data