Sample to binary Serialization