Adding this method will simplify the process of data conversion for various purposes such as saving, network transmission and further processing. Modders will be able to use this method to quickly and easily convert data into a Base64 string without having to implement their own conversion logic.
Example of possible usage:
class Foo { void SaveItem(ItemBase ib) { ScriptReadWriteContext ctx = new ScriptReadWriteContext; ib.OnStoreSave(ctx.GetWriteContext()); string base64 = ctx.GetReadContext().ToBase64String(); //send base64 via restAPI } void LoadItem(string type, string data) { ScriptReadWriteContext ctx = new ScriptReadWriteContext; ParamsReadContext read_ctx = ctx.GetReadContext(); if (read_ctx.FromBase64String(data)) { ItemBase ib; if ( Class.CastTo(ib, GetGame().CreateObjectEx(type, vector.Zero, ECE_PLACE_ON_SURFACE)) ) ib.OnStoreLoad(read_ctx, int.MAX); } } }