public void convert(string name, ParameterParser args, Stream from, Stream to) { var obj = VarConfig.ReadNew(from); byte[] buffer = Encoding.Default.GetBytes(Utils.convertToJSON(obj)); to.Write(buffer, 0, buffer.Length); }
public void read() { MemoryStream stream = new MemoryStream(sampleData, false); VarConfig cfg = VarConfig.ReadNew(stream); testConfig(cfg); }
public void write() { MemoryStream readStream = new MemoryStream(sampleData, false); VarConfig cfg = VarConfig.ReadNew(readStream); MemoryStream writeStream = new MemoryStream(); cfg.Write(writeStream); MemoryStream rereadStream = new MemoryStream(writeStream.ToArray(), false); VarConfig rereadCfg = VarConfig.ReadNew(rereadStream); testConfig(rereadCfg); }