Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public void read()
        {
            MemoryStream stream = new MemoryStream(sampleData, false);
            VarConfig    cfg    = VarConfig.ReadNew(stream);

            testConfig(cfg);
        }
Esempio n. 3
0
        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);
        }