I'm creating a console application that will convert a big json file (around 900mb) into a different format (will be output into a new json file).
My objective is to make sure the output file doesnt exceed 10mb. I think I need to check the size of the JObject before output it into a json file. If the JObject exceeded 10mb, the current object will not be added into the JObject and the JObject (< 10mb) will be written into a json file, the subsequent objects will then be added into a new JObject until it reaches the limit of 10mb again.
So, the question is how can I determine the size (not length/count) of the JObject, I tried convert it into byte array but when I sum all the bytes and divide by (1024x1024) but it doesn't work.