resource to binary