public static ResultLogObjectWriter GetConverterObjects(IToolFileConverter converter, byte[] inputData) { var result = new ResultLogObjectWriter(); using (var input = new MemoryStream(inputData)) { converter.Convert(input, result); } return(result); }
public static string GetConverterJson(IToolFileConverter converter, byte[] inputData) { using (var input = new MemoryStream(inputData)) { using (var output = new StringWriter()) { var json = new JsonTextWriter(output); json.Formatting = Newtonsoft.Json.Formatting.Indented; json.CloseOutput = false; using (var outputWriter = new ResultLogJsonWriter(json)) { converter.Convert(input, outputWriter); } return(output.ToString()); } } }
public static ResultLogObjectWriter GetConverterObjects(IToolFileConverter converter, string inputData) { return(GetConverterObjects(converter, Encoding.UTF8.GetBytes(inputData))); }
public static string GetConverterJson(IToolFileConverter converter, string inputData) { return(GetConverterJson(converter, Encoding.UTF8.GetBytes(inputData))); }