How to automatic serialize USTRUCT to array of bytes?

How to automatic serialize instance of USTRUCT variable via reflection system if all properties are marked with UPROPERTY to array of bytes (TArray)? Any function or module inside engine maybe available about which i do not know?

I’m not sure if this will answer your question, but one way of getting your USTRUCT into an array of bytes can be done like so:

USTRUCT()
struct FSaveMyStruct
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY()
	int32 AnyInt32;
};

FSaveMyStruct MyStructInstance;
MyStructInstance.AnyInt32 = 77;

FBufferArchive Buffer(true);
FSaveMyStruct::StaticStruct()->SerializeBin(Buffer, &MyStructInstance);

TArray<uint8> Bytes = Buffer;

Since FBufferArchive inherits from TArray you could just use any TArray
functions on Buffer. Hope this helps.

Oh, dunno how I missed it. I saw there is JSON automatic serializer and wanted to implement my own binary. Now I don’t need to do it, Thank you!