コード例 #1
0
 public static void Pack(object data, Stream stream)
 {
     if (stream != null)
     {
         if (stream.CanWrite)
         {
             if (data == null)
             {
                 CpInazumaMsgPack.\uE00B(null, global::\uE015.\uE00A, stream);
                 return;
             }
             if (data.GetType().IsPrimitive)
             {
                 CpInazumaMsgPack.\uE015(data, stream);
                 return;
             }
             if (data is string)
             {
                 CpInazumaMsgPack.\uE018((string)data, stream);
                 return;
             }
             if (data is byte[])
             {
                 CpInazumaMsgPack.\uE019((byte[])data, stream);
                 return;
             }
             if (data is IList)
             {
                 CpInazumaMsgPack.\uE016((IList)data, stream);
                 return;
             }
             if (data is IDictionary)
             {
                 CpInazumaMsgPack.\uE017((IDictionary)data, stream);
                 return;
             }
             \uE017 uE = default(\uE017);
             if (CpInazumaMsgPack.\uE022(data.GetType(), ref uE))
             {
                 CpInazumaMsgPack.\uE01A(data, ref uE, stream);
             }
             return;
         }
     }
     throw new IOException(global::\uE019.\uE000(11502));
 }