private static void \uE01A(object \uE049, ref \uE017 \uE04A, Stream \uE04B) { if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Array) { CpInazumaMsgPack.\uE00B(\uE04A.\uE001.Count, CpInazumaMsgPack.\uE007(\uE04A.\uE001.Count), \uE04B); } if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Raw || CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Array) { for (int i = 0; i < \uE04A.\uE001.Count; i++) { \uE016 uE = \uE04A.\uE001[i]; CpInazumaMsgPack.Pack(uE.\uE002.GetValue(\uE049), \uE04B); } return; } if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Map || CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Older) { CpInazumaMsgPack.\uE00B(\uE04A.\uE001.Count, CpInazumaMsgPack.\uE006(\uE04A.\uE001.Count), \uE04B); for (int j = 0; j < \uE04A.\uE001.Count; j++) { \uE016 uE2 = \uE04A.\uE001[j]; CpInazumaMsgPack.\uE018(uE2.\uE001, \uE04B); CpInazumaMsgPack.Pack(uE2.\uE002.GetValue(\uE049), \uE04B); } } }
private static void \uE019(byte[] \uE047, Stream \uE048) { int num = \uE047.Length; if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Older) { \uE048.WriteByte(219); \uE048.Write(CpInazumaMsgPack.\uE000(BitConverter.GetBytes(num)), 0, 4); } else { CpInazumaMsgPack.\uE00B(num, CpInazumaMsgPack.\uE009(num), \uE048); } \uE048.Write(\uE047, 0, \uE047.Length); }
private static void \uE018(string \uE045, Stream \uE046) { byte[] bytes = CpInazumaMsgPack.\uE000.GetBytes(\uE045); int num = bytes.Length; if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Older) { \uE046.WriteByte(219); \uE046.Write(CpInazumaMsgPack.\uE000(BitConverter.GetBytes(num)), 0, 4); } else { CpInazumaMsgPack.\uE00B(num, CpInazumaMsgPack.\uE008(num), \uE046); } \uE046.Write(bytes, 0, bytes.Length); }
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)); }
private static void \uE016(IList \uE041, Stream \uE042) { int count = \uE041.Count; if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Older) { \uE042.WriteByte(221); \uE042.Write(CpInazumaMsgPack.\uE000(BitConverter.GetBytes(count)), 0, 4); } else { CpInazumaMsgPack.\uE00B(\uE041.Count, CpInazumaMsgPack.\uE007(count), \uE042); } for (int i = 0; i < count; i++) { CpInazumaMsgPack.Pack(\uE041[i], \uE042); } }
private static void \uE017(IDictionary \uE043, Stream \uE044) { int count = \uE043.Count; if (CpInazumaMsgPack.\uE005 == CpCustomDataPackMode.Older) { \uE044.WriteByte(223); \uE044.Write(CpInazumaMsgPack.\uE000(BitConverter.GetBytes(count)), 0, 4); } else { CpInazumaMsgPack.\uE00B(count, CpInazumaMsgPack.\uE006(count), \uE044); } foreach (object obj in \uE043) { DictionaryEntry dictionaryEntry = (DictionaryEntry)obj; CpInazumaMsgPack.Pack(dictionaryEntry.Key, \uE044); CpInazumaMsgPack.Pack(dictionaryEntry.Value, \uE044); } }
private static void \uE015(object \uE03F, Stream \uE040) { TypeCode typeCode = Type.GetTypeCode(\uE03F.GetType()); if (CpInazumaMsgPack.\uE00D(typeCode) && Convert.ToInt64(\uE03F) < 0L && Convert.ToInt64(\uE03F) >= -32L) { CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE001, \uE040); return; } if (CpInazumaMsgPack.\uE00C(typeCode)) { if (!CpInazumaMsgPack.\uE00D(typeCode)) { if (Convert.ToUInt64(\uE03F) <= 127UL) { CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE000, \uE040); return; } } } switch (typeCode) { case TypeCode.Boolean: CpInazumaMsgPack.\uE00B(null, ((bool)\uE03F) ? global::\uE015.\uE00D : global::\uE015.\uE00C, \uE040); return; case TypeCode.Char: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE017, \uE040); return; case TypeCode.SByte: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE01A, \uE040); return; case TypeCode.Byte: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE016, \uE040); return; case TypeCode.Int16: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE01B, \uE040); return; case TypeCode.UInt16: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE017, \uE040); return; case TypeCode.Int32: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE01C, \uE040); return; case TypeCode.UInt32: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE018, \uE040); return; case TypeCode.Int64: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE01D, \uE040); return; case TypeCode.UInt64: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE019, \uE040); return; case TypeCode.Single: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE014, \uE040); return; case TypeCode.Double: CpInazumaMsgPack.\uE00B(\uE03F, global::\uE015.\uE015, \uE040); return; default: return; } }