Ejemplo n.º 1
0
 public static string Dump(Stream stream)
 {
     if (stream != null && stream.CanRead)
     {
         if (stream.CanSeek)
         {
             StringBuilder stringBuilder = new StringBuilder(CpInazumaMsgPack.\uE003);
             int           num           = 0;
             stringBuilder.Append(global::\uE019.\uE000(11514));
             long position = stream.Position;
             while (stream.Position < stream.Length)
             {
                 long   position2 = stream.Position;
                 sbyte  uE        = 0;
                 \uE015 uE2       = CpInazumaMsgPack.\uE00A(stream, out uE);
                 string arg       = CpInazumaMsgPack.\uE023(stream, uE2, uE);
                 num++;
                 stringBuilder.AppendFormat(global::\uE019.\uE000(11475), global::\uE019.\uE000(11297), uE2);
                 stringBuilder.AppendFormat(global::\uE019.\uE000(11475), global::\uE019.\uE000(11320), arg);
                 stringBuilder.AppendFormat(global::\uE019.\uE000(11312), global::\uE019.\uE000(11294), position2);
                 stringBuilder.AppendFormat(global::\uE019.\uE000(11312), global::\uE019.\uE000(11285), stream.Position - position2);
                 stringBuilder.Append(global::\uE019.\uE000(11372));
             }
             stringBuilder.AppendFormat(global::\uE019.\uE000(11333), global::\uE019.\uE000(11347), stream.Length);
             stringBuilder.AppendFormat(global::\uE019.\uE000(12197), global::\uE019.\uE000(12214), num);
             stringBuilder.AppendFormat(global::\uE019.\uE000(12169), global::\uE019.\uE000(12183), (double)stream.Length / (double)num);
             stringBuilder.Append(global::\uE019.\uE000(12259));
             stream.Seek(position, SeekOrigin.Begin);
             return(stringBuilder.ToString());
         }
     }
     return(string.Empty);
 }
Ejemplo n.º 2
0
        private static object \uE020(Stream \uE05D, ref \uE017 \uE05E)
        {
            sbyte  b   = 0;
            \uE015 uE  = CpInazumaMsgPack.\uE00A(\uE05D, out b);
            object obj = Activator.CreateInstance(\uE05E.\uE000);

            if (CpInazumaMsgPack.\uE010(uE))
            {
                int num = CpInazumaMsgPack.\uE005(\uE05D, uE, b);
                for (int i = 0; i < num; i++)
                {
                    CpInazumaMsgPack.\uE001 uE2 = new CpInazumaMsgPack.\uE001();
                    uE         = CpInazumaMsgPack.\uE00A(\uE05D, out b);
                    uE2.\uE000 = CpInazumaMsgPack.\uE01E(\uE05D, uE, b);
                    \uE016 uE3 = \uE05E.\uE001.Find(new Predicate <\uE016>(uE2.\uE000));
                    if (uE3 == null)
                    {
                        CpInazumaMsgPack.Unpack(\uE05D, typeof(object));
                    }
                    else
                    {
                        TypeCode typeCode = Type.GetTypeCode(uE3.\uE002.FieldType);
                        object   value    = CpInazumaMsgPack.\uE014(CpInazumaMsgPack.Unpack(\uE05D, uE3.\uE002.FieldType), typeCode);
                        uE3.\uE002.SetValue(obj, value);
                    }
                }
                return(obj);
            }
            if (CpInazumaMsgPack.\uE00F(uE))
            {
                \uE05D.Seek((long)CpInazumaMsgPack.\uE004(uE, b), SeekOrigin.Current);
                return(CpInazumaMsgPack.\uE020(\uE05D, ref \uE05E));
            }
            \uE05D.Seek(-1L, SeekOrigin.Current);
            if (uE == global::\uE015.\uE00A)
            {
                return(null);
            }
            for (int j = 0; j < \uE05E.\uE001.Count; j++)
            {
                FieldInfo uE4  = \uE05E.\uE001[j].\uE002;
                object    obj2 = CpInazumaMsgPack.Unpack(\uE05D, uE4.FieldType);
                if (obj2 != null)
                {
                    uE4.SetValue(obj, Convert.ChangeType(obj2, uE4.FieldType));
                }
            }
            return(obj);
        }
Ejemplo n.º 3
0
 public static object Unpack(Stream stream, Type type)
 {
     if (stream != null && stream.CanRead)
     {
         if (stream.CanSeek)
         {
             \uE017 uE = default(\uE017);
             if (CpInazumaMsgPack.\uE022(type, ref uE))
             {
                 return(CpInazumaMsgPack.\uE020(stream, ref uE));
             }
             sbyte  b   = 0;
             \uE015 uE2 = CpInazumaMsgPack.\uE00A(stream, out b);
             if (uE2 == global::\uE015.\uE00B)
             {
                 stream.Seek(-1L, SeekOrigin.Current);
                 return(null);
             }
             if (uE2 == global::\uE015.\uE00A)
             {
                 return(null);
             }
             if (CpInazumaMsgPack.\uE00E(uE2))
             {
                 return(CpInazumaMsgPack.\uE01B(stream, uE2, b));
             }
             if (CpInazumaMsgPack.\uE00F(uE2))
             {
                 return(CpInazumaMsgPack.\uE01C(stream, uE2, b, type));
             }
             if (CpInazumaMsgPack.\uE010(uE2))
             {
                 return(CpInazumaMsgPack.\uE01D(stream, uE2, b, type));
             }
             if (CpInazumaMsgPack.\uE011(uE2))
             {
                 return(CpInazumaMsgPack.\uE01E(stream, uE2, b));
             }
             if (CpInazumaMsgPack.\uE012(uE2))
             {
                 return(CpInazumaMsgPack.\uE01F(stream, uE2, b));
             }
             stream.Seek(-1L, SeekOrigin.Current);
             return(null);
         }
     }
     throw new IOException(global::\uE019.\uE000(11502));
 }