Serialize and deserialize a mesh to a file

I’m trying to serialize and deserialize a mesh to a file,
the first part is working, however, the deserialization is through an error.
what should I do to fix it?

Still haven’t tested this but I believe you should use pickle

I tried with pickle, and it didn’t work with meshes as well.

it’s very strange that CommonObjectToByteArray worked well, however, ByteArrayToCommonObject gives this error:

“1. Solution exception:The type arguments for method ‘ByteArrayToCommonObject’ cannot be inferred from the usage. Try specifying the type arguments explicitly.”