using System; using System.Collections; using System.Text; namespace Mono { // Token: 0x020000F4 RID: 244 internal abstract class DataConverter { // Token: 0x06000C17 RID: 3095 public abstract double GetDouble(byte[] data, int index); // Token: 0x06000C18 RID: 3096 public abstract float GetFloat(byte[] data, int index); // Token: 0x06000C19 RID: 3097 public abstract long GetInt64(byte[] data, int index); // Token: 0x06000C1A RID: 3098 public abstract int GetInt32(byte[] data, int index); // Token: 0x06000C1B RID: 3099 public abstract short GetInt16(byte[] data, int index); // Token: 0x06000C1C RID: 3100 [CLSCompliant(false)] public abstract uint GetUInt32(byte[] data, int index); // Token: 0x06000C1D RID: 3101 [CLSCompliant(false)] public abstract ushort GetUInt16(byte[] data, int index); // Token: 0x06000C1E RID: 3102 [CLSCompliant(false)] public abstract ulong GetUInt64(byte[] data, int index); // Token: 0x06000C1F RID: 3103 public abstract void PutBytes(byte[] dest, int destIdx, double value); // Token: 0x06000C20 RID: 3104 public abstract void PutBytes(byte[] dest, int destIdx, float value); // Token: 0x06000C21 RID: 3105 public abstract void PutBytes(byte[] dest, int destIdx, int value); // Token: 0x06000C22 RID: 3106 public abstract void PutBytes(byte[] dest, int destIdx, long value); // Token: 0x06000C23 RID: 3107 public abstract void PutBytes(byte[] dest, int destIdx, short value); // Token: 0x06000C24 RID: 3108 [CLSCompliant(false)] public abstract void PutBytes(byte[] dest, int destIdx, ushort value); // Token: 0x06000C25 RID: 3109 [CLSCompliant(false)] public abstract void PutBytes(byte[] dest, int destIdx, uint value); // Token: 0x06000C26 RID: 3110 [CLSCompliant(false)] public abstract void PutBytes(byte[] dest, int destIdx, ulong value); // Token: 0x06000C27 RID: 3111 RVA: 0x00036968 File Offset: 0x00034B68 public byte[] GetBytes(double value) { byte[] array = new byte[8]; this.PutBytes(array, 0, value); return array; } // Token: 0x06000C28 RID: 3112 RVA: 0x00036988 File Offset: 0x00034B88 public byte[] GetBytes(float value) { byte[] array = new byte[4]; this.PutBytes(array, 0, value); return array; } // Token: 0x06000C29 RID: 3113 RVA: 0x000369A8 File Offset: 0x00034BA8 public byte[] GetBytes(int value) { byte[] array = new byte[4]; this.PutBytes(array, 0, value); return array; } // Token: 0x06000C2A RID: 3114 RVA: 0x000369C8 File Offset: 0x00034BC8 public byte[] GetBytes(long value) { byte[] array = new byte[8]; this.PutBytes(array, 0, value); return array; } // Token: 0x06000C2B RID: 3115 RVA: 0x000369E8 File Offset: 0x00034BE8 public byte[] GetBytes(short value) { byte[] array = new byte[2]; this.PutBytes(array, 0, value); return array; } // Token: 0x06000C2C RID: 3116 RVA: 0x00036A08 File Offset: 0x00034C08 [CLSCompliant(false)] public byte[] GetBytes(ushort value) { byte[] array = new byte[2]; this.PutBytes(array, 0, value); return array; } // Token: 0x06000C2D RID: 3117 RVA: 0x00036A28 File Offset: 0x00034C28 [CLSCompliant(false)] public byte[] GetBytes(uint value) { byte[] array = new byte[4]; this.PutBytes(array, 0, value); return array; } // Token: 0x06000C2E RID: 3118 RVA: 0x00036A48 File Offset: 0x00034C48 [CLSCompliant(false)] public byte[] GetBytes(ulong value) { byte[] array = new byte[8]; this.PutBytes(array, 0, value); return array; } // Token: 0x170001C2 RID: 450 // (get) Token: 0x06000C2F RID: 3119 RVA: 0x00036A68 File Offset: 0x00034C68 public static DataConverter LittleEndian { get { return (!BitConverter.IsLittleEndian) ? DataConverter.SwapConv : DataConverter.CopyConv; } } // Token: 0x170001C3 RID: 451 // (get) Token: 0x06000C30 RID: 3120 RVA: 0x00036A84 File Offset: 0x00034C84 public static DataConverter BigEndian { get { return (!BitConverter.IsLittleEndian) ? DataConverter.CopyConv : DataConverter.SwapConv; } } // Token: 0x170001C4 RID: 452 // (get) Token: 0x06000C31 RID: 3121 RVA: 0x00036AA0 File Offset: 0x00034CA0 public static DataConverter Native { get { return DataConverter.CopyConv; } } // Token: 0x06000C32 RID: 3122 RVA: 0x00036AA8 File Offset: 0x00034CA8 private static int Align(int current, int align) { return (current + align - 1) / align * align; } // Token: 0x06000C33 RID: 3123 RVA: 0x00036AB4 File Offset: 0x00034CB4 public static byte[] Pack(string description, params object[] args) { int num = 0; DataConverter.PackContext packContext = new DataConverter.PackContext(); packContext.conv = DataConverter.CopyConv; packContext.description = description; packContext.i = 0; while (packContext.i < description.Length) { object obj; if (num < args.Length) { obj = args[num]; } else { if (packContext.repeat != 0) { break; } obj = null; } int i = packContext.i; if (DataConverter.PackOne(packContext, obj)) { num++; if (packContext.repeat > 0) { if (--packContext.repeat > 0) { packContext.i = i; } else { packContext.i++; } } else { packContext.i++; } } else { packContext.i++; } } return packContext.Get(); } // Token: 0x06000C34 RID: 3124 RVA: 0x00036BA0 File Offset: 0x00034DA0 public static byte[] PackEnumerable(string description, IEnumerable args) { DataConverter.PackContext packContext = new DataConverter.PackContext(); packContext.conv = DataConverter.CopyConv; packContext.description = description; IEnumerator enumerator = args.GetEnumerator(); bool flag = enumerator.MoveNext(); packContext.i = 0; while (packContext.i < description.Length) { object obj; if (flag) { obj = enumerator.Current; } else { if (packContext.repeat != 0) { break; } obj = null; } int i = packContext.i; if (DataConverter.PackOne(packContext, obj)) { flag = enumerator.MoveNext(); if (packContext.repeat > 0) { if (--packContext.repeat > 0) { packContext.i = i; } else { packContext.i++; } } else { packContext.i++; } } else { packContext.i++; } } return packContext.Get(); } // Token: 0x06000C35 RID: 3125 RVA: 0x00036C9C File Offset: 0x00034E9C private static bool PackOne(DataConverter.PackContext b, object oarg) { char c = b.description[b.i]; switch (c) { case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': b.repeat = (int)((short)b.description[b.i] - 48); return false; default: switch (c) { case '[': { int num = -1; int i; for (i = b.i + 1; i < b.description.Length; i++) { if (b.description[i] == ']') { break; } int num2 = (int)((short)b.description[i] - 48); if (num2 >= 0 && num2 <= 9) { if (num == -1) { num = num2; } else { num = num * 10 + num2; } } } if (num == -1) { throw new ArgumentException("invalid size specification"); } b.i = i; b.repeat = num; return false; } default: { switch (c) { case '!': b.align = -1; return false; default: switch (c) { case 'I': b.Add(b.conv.GetBytes(Convert.ToUInt32(oarg))); return true; default: switch (c) { case 'x': b.Add(new byte[1]); return false; default: if (c == '*') { b.repeat = int.MaxValue; return false; } if (c == 'S') { b.Add(b.conv.GetBytes(Convert.ToUInt16(oarg))); return true; } if (c != 's') { throw new ArgumentException(string.Format("invalid format specified `{0}'", b.description[b.i])); } b.Add(b.conv.GetBytes(Convert.ToInt16(oarg))); return true; case 'z': break; } break; case 'L': b.Add(b.conv.GetBytes(Convert.ToUInt64(oarg))); return true; } break; case '$': break; case '%': b.conv = DataConverter.Native; return false; } bool flag = b.description[b.i] == 'z'; b.i++; if (b.i >= b.description.Length) { throw new ArgumentException("$ description needs a type specified", "description"); } char c2 = b.description[b.i]; char c3 = c2; int num2; Encoding encoding; switch (c3) { case '3': encoding = Encoding.GetEncoding(12000); num2 = 4; break; case '4': encoding = Encoding.GetEncoding(12001); num2 = 4; break; default: if (c3 != 'b') { throw new ArgumentException("Invalid format for $ specifier", "description"); } encoding = Encoding.BigEndianUnicode; num2 = 2; break; case '6': encoding = Encoding.Unicode; num2 = 2; break; case '7': encoding = Encoding.UTF7; num2 = 1; break; case '8': encoding = Encoding.UTF8; num2 = 1; break; } if (b.align == -1) { b.align = 4; } b.Add(encoding.GetBytes(Convert.ToString(oarg))); if (flag) { b.Add(new byte[num2]); } break; } case '^': b.conv = DataConverter.BigEndian; return false; case '_': b.conv = DataConverter.LittleEndian; return false; case 'b': b.Add(new byte[] { Convert.ToByte(oarg) }); break; case 'c': b.Add(new byte[] { (byte)Convert.ToSByte(oarg) }); break; case 'd': b.Add(b.conv.GetBytes(Convert.ToDouble(oarg))); break; case 'f': b.Add(b.conv.GetBytes(Convert.ToSingle(oarg))); break; case 'i': b.Add(b.conv.GetBytes(Convert.ToInt32(oarg))); break; case 'l': b.Add(b.conv.GetBytes(Convert.ToInt64(oarg))); break; } break; case 'C': b.Add(new byte[] { Convert.ToByte(oarg) }); break; } return true; } // Token: 0x06000C36 RID: 3126 RVA: 0x00037160 File Offset: 0x00035360 private static bool Prepare(byte[] buffer, ref int idx, int size, ref bool align) { if (align) { idx = DataConverter.Align(idx, size); align = false; } if (idx + size > buffer.Length) { idx = buffer.Length; return false; } return true; } // Token: 0x06000C37 RID: 3127 RVA: 0x00037198 File Offset: 0x00035398 public static IList Unpack(string description, byte[] buffer, int startIndex) { DataConverter dataConverter = DataConverter.CopyConv; ArrayList arrayList = new ArrayList(); int num = startIndex; bool flag = false; int num2 = 0; int num3 = 0; while (num3 < description.Length && num < buffer.Length) { int num4 = num3; char c = description[num3]; switch (c) { case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': num2 = (int)((short)description[num3] - 48); num4 = num3 + 1; break; default: switch (c) { case '[': { int num5 = -1; int i; for (i = num3 + 1; i < description.Length; i++) { if (description[i] == ']') { break; } int num6 = (int)((short)description[i] - 48); if (num6 >= 0 && num6 <= 9) { if (num5 == -1) { num5 = num6; } else { num5 = num5 * 10 + num6; } } } if (num5 == -1) { throw new ArgumentException("invalid size specification"); } num3 = i; num2 = num5; break; } default: { switch (c) { case '!': flag = true; goto IL_683; default: switch (c) { case 'I': if (DataConverter.Prepare(buffer, ref num, 4, ref flag)) { arrayList.Add(dataConverter.GetUInt32(buffer, num)); num += 4; } goto IL_683; default: switch (c) { case 'x': num++; goto IL_683; default: if (c == '*') { num2 = int.MaxValue; goto IL_683; } if (c == 'S') { if (DataConverter.Prepare(buffer, ref num, 2, ref flag)) { arrayList.Add(dataConverter.GetUInt16(buffer, num)); num += 2; } goto IL_683; } if (c != 's') { throw new ArgumentException(string.Format("invalid format specified `{0}'", description[num3])); } if (DataConverter.Prepare(buffer, ref num, 2, ref flag)) { arrayList.Add(dataConverter.GetInt16(buffer, num)); num += 2; } goto IL_683; case 'z': break; } break; case 'L': if (DataConverter.Prepare(buffer, ref num, 8, ref flag)) { arrayList.Add(dataConverter.GetUInt64(buffer, num)); num += 8; } goto IL_683; } break; case '$': break; case '%': dataConverter = DataConverter.Native; goto IL_683; } num3++; if (num3 >= description.Length) { throw new ArgumentException("$ description needs a type specified", "description"); } char c2 = description[num3]; if (flag) { num = DataConverter.Align(num, 4); flag = false; } if (num < buffer.Length) { char c3 = c2; int num6; Encoding encoding; switch (c3) { case '3': encoding = Encoding.GetEncoding(12000); num6 = 4; break; case '4': encoding = Encoding.GetEncoding(12001); num6 = 4; break; default: if (c3 != 'b') { throw new ArgumentException("Invalid format for $ specifier", "description"); } encoding = Encoding.BigEndianUnicode; num6 = 2; break; case '6': encoding = Encoding.Unicode; num6 = 2; break; case '7': encoding = Encoding.UTF7; num6 = 1; break; case '8': encoding = Encoding.UTF8; num6 = 1; break; } int j = num; switch (num6) { case 1: while (j < buffer.Length && buffer[j] != 0) { j++; } arrayList.Add(encoding.GetChars(buffer, num, j - num)); if (j == buffer.Length) { num = j; } else { num = j + 1; } break; case 2: while (j < buffer.Length) { if (j + 1 == buffer.Length) { j++; break; } if (buffer[j] == 0 && buffer[j + 1] == 0) { break; } j++; } arrayList.Add(encoding.GetChars(buffer, num, j - num)); if (j == buffer.Length) { num = j; } else { num = j + 2; } break; case 4: while (j < buffer.Length) { if (j + 3 >= buffer.Length) { j = buffer.Length; break; } if (buffer[j] == 0 && buffer[j + 1] == 0 && buffer[j + 2] == 0 && buffer[j + 3] == 0) { break; } j++; } arrayList.Add(encoding.GetChars(buffer, num, j - num)); if (j == buffer.Length) { num = j; } else { num = j + 4; } break; } } break; } case '^': dataConverter = DataConverter.BigEndian; break; case '_': dataConverter = DataConverter.LittleEndian; break; case 'b': if (DataConverter.Prepare(buffer, ref num, 1, ref flag)) { arrayList.Add(buffer[num]); num++; } break; case 'c': goto IL_300; case 'd': if (DataConverter.Prepare(buffer, ref num, 8, ref flag)) { arrayList.Add(dataConverter.GetDouble(buffer, num)); num += 8; } break; case 'f': if (DataConverter.Prepare(buffer, ref num, 4, ref flag)) { arrayList.Add(dataConverter.GetDouble(buffer, num)); num += 4; } break; case 'i': if (DataConverter.Prepare(buffer, ref num, 4, ref flag)) { arrayList.Add(dataConverter.GetInt32(buffer, num)); num += 4; } break; case 'l': if (DataConverter.Prepare(buffer, ref num, 8, ref flag)) { arrayList.Add(dataConverter.GetInt64(buffer, num)); num += 8; } break; } break; case 'C': goto IL_300; } IL_683: if (num2 > 0) { if (--num2 > 0) { num3 = num4; } continue; } num3++; continue; IL_300: if (DataConverter.Prepare(buffer, ref num, 1, ref flag)) { char c4; if (description[num3] == 'c') { c4 = (char)((sbyte)buffer[num]); } else { c4 = (char)buffer[num]; } arrayList.Add(c4); num++; } goto IL_683; } return arrayList; } // Token: 0x06000C38 RID: 3128 RVA: 0x00037864 File Offset: 0x00035A64 internal void Check(byte[] dest, int destIdx, int size) { if (dest == null) { throw new ArgumentNullException("dest"); } if (destIdx < 0 || destIdx > dest.Length - size) { throw new ArgumentException("destIdx"); } } // Token: 0x04000353 RID: 851 private static DataConverter SwapConv = new DataConverter.SwapConverter(); // Token: 0x04000354 RID: 852 private static DataConverter CopyConv = new DataConverter.CopyConverter(); // Token: 0x04000355 RID: 853 public static readonly bool IsLittleEndian = BitConverter.IsLittleEndian; // Token: 0x020000F5 RID: 245 private class PackContext { // Token: 0x06000C3A RID: 3130 RVA: 0x000378A8 File Offset: 0x00035AA8 public void Add(byte[] group) { if (this.buffer == null) { this.buffer = group; this.next = group.Length; return; } if (this.align != 0) { if (this.align == -1) { this.next = DataConverter.Align(this.next, group.Length); } else { this.next = DataConverter.Align(this.next, this.align); } this.align = 0; } if (this.next + group.Length > this.buffer.Length) { byte[] array = new byte[Math.Max(this.next, 16) * 2 + group.Length]; Array.Copy(this.buffer, array, this.buffer.Length); Array.Copy(group, 0, array, this.next, group.Length); this.next += group.Length; this.buffer = array; } else { Array.Copy(group, 0, this.buffer, this.next, group.Length); this.next += group.Length; } } // Token: 0x06000C3B RID: 3131 RVA: 0x000379B8 File Offset: 0x00035BB8 public byte[] Get() { if (this.buffer == null) { return new byte[0]; } if (this.buffer.Length != this.next) { byte[] array = new byte[this.next]; Array.Copy(this.buffer, array, this.next); return array; } return this.buffer; } // Token: 0x04000356 RID: 854 public byte[] buffer; // Token: 0x04000357 RID: 855 private int next; // Token: 0x04000358 RID: 856 public string description; // Token: 0x04000359 RID: 857 public int i; // Token: 0x0400035A RID: 858 public DataConverter conv; // Token: 0x0400035B RID: 859 public int repeat; // Token: 0x0400035C RID: 860 public int align; } // Token: 0x020000F6 RID: 246 private class CopyConverter : DataConverter { // Token: 0x06000C3D RID: 3133 RVA: 0x00037A18 File Offset: 0x00035C18 public unsafe override double GetDouble(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 8) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } double num; for (int i = 0; i < 8; i++) { *((ref num) + i) = data[index + i]; } return num; } // Token: 0x06000C3E RID: 3134 RVA: 0x00037A80 File Offset: 0x00035C80 public unsafe override ulong GetUInt64(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 8) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } ulong num; for (int i = 0; i < 8; i++) { *((ref num) + i) = data[index + i]; } return num; } // Token: 0x06000C3F RID: 3135 RVA: 0x00037AE8 File Offset: 0x00035CE8 public unsafe override long GetInt64(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 8) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } long num; for (int i = 0; i < 8; i++) { *((ref num) + i) = data[index + i]; } return num; } // Token: 0x06000C40 RID: 3136 RVA: 0x00037B50 File Offset: 0x00035D50 public unsafe override float GetFloat(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 4) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } float num; for (int i = 0; i < 4; i++) { *((ref num) + i) = data[index + i]; } return num; } // Token: 0x06000C41 RID: 3137 RVA: 0x00037BB8 File Offset: 0x00035DB8 public unsafe override int GetInt32(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 4) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } int num; for (int i = 0; i < 4; i++) { *((ref num) + i) = data[index + i]; } return num; } // Token: 0x06000C42 RID: 3138 RVA: 0x00037C20 File Offset: 0x00035E20 public unsafe override uint GetUInt32(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 4) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } uint num; for (int i = 0; i < 4; i++) { *((ref num) + i) = data[index + i]; } return num; } // Token: 0x06000C43 RID: 3139 RVA: 0x00037C88 File Offset: 0x00035E88 public unsafe override short GetInt16(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 2) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } short num; for (int i = 0; i < 2; i++) { *((ref num) + i) = data[index + i]; } return num; } // Token: 0x06000C44 RID: 3140 RVA: 0x00037CF0 File Offset: 0x00035EF0 public unsafe override ushort GetUInt16(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 2) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } ushort num; for (int i = 0; i < 2; i++) { *((ref num) + i) = data[index + i]; } return num; } // Token: 0x06000C45 RID: 3141 RVA: 0x00037D58 File Offset: 0x00035F58 public unsafe override void PutBytes(byte[] dest, int destIdx, double value) { base.Check(dest, destIdx, 8); fixed (byte* ptr = &dest[destIdx]) { *(long*)ptr = (long)value; } } // Token: 0x06000C46 RID: 3142 RVA: 0x00037D80 File Offset: 0x00035F80 public unsafe override void PutBytes(byte[] dest, int destIdx, float value) { base.Check(dest, destIdx, 4); fixed (byte* ptr = &dest[destIdx]) { *(int*)ptr = (int)value; } } // Token: 0x06000C47 RID: 3143 RVA: 0x00037DA8 File Offset: 0x00035FA8 public unsafe override void PutBytes(byte[] dest, int destIdx, int value) { base.Check(dest, destIdx, 4); fixed (byte* ptr = &dest[destIdx]) { *(int*)ptr = value; } } // Token: 0x06000C48 RID: 3144 RVA: 0x00037DD0 File Offset: 0x00035FD0 public unsafe override void PutBytes(byte[] dest, int destIdx, uint value) { base.Check(dest, destIdx, 4); fixed (byte* ptr = &dest[destIdx]) { *(int*)ptr = (int)value; } } // Token: 0x06000C49 RID: 3145 RVA: 0x00037DF8 File Offset: 0x00035FF8 public unsafe override void PutBytes(byte[] dest, int destIdx, long value) { base.Check(dest, destIdx, 8); fixed (byte* ptr = &dest[destIdx]) { *(long*)ptr = value; } } // Token: 0x06000C4A RID: 3146 RVA: 0x00037E20 File Offset: 0x00036020 public unsafe override void PutBytes(byte[] dest, int destIdx, ulong value) { base.Check(dest, destIdx, 8); fixed (byte* ptr = &dest[destIdx]) { *(long*)ptr = (long)value; } } // Token: 0x06000C4B RID: 3147 RVA: 0x00037E48 File Offset: 0x00036048 public unsafe override void PutBytes(byte[] dest, int destIdx, short value) { base.Check(dest, destIdx, 2); fixed (byte* ptr = &dest[destIdx]) { *(short*)ptr = value; } } // Token: 0x06000C4C RID: 3148 RVA: 0x00037E70 File Offset: 0x00036070 public unsafe override void PutBytes(byte[] dest, int destIdx, ushort value) { base.Check(dest, destIdx, 2); fixed (byte* ptr = &dest[destIdx]) { *(short*)ptr = (short)value; } } } // Token: 0x020000F7 RID: 247 private class SwapConverter : DataConverter { // Token: 0x06000C4E RID: 3150 RVA: 0x00037EA0 File Offset: 0x000360A0 public unsafe override double GetDouble(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 8) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } double num; for (int i = 0; i < 8; i++) { *((ref num) + (7 - i)) = data[index + i]; } return num; } // Token: 0x06000C4F RID: 3151 RVA: 0x00037F08 File Offset: 0x00036108 public unsafe override ulong GetUInt64(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 8) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } ulong num; for (int i = 0; i < 8; i++) { *((ref num) + (7 - i)) = data[index + i]; } return num; } // Token: 0x06000C50 RID: 3152 RVA: 0x00037F70 File Offset: 0x00036170 public unsafe override long GetInt64(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 8) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } long num; for (int i = 0; i < 8; i++) { *((ref num) + (7 - i)) = data[index + i]; } return num; } // Token: 0x06000C51 RID: 3153 RVA: 0x00037FD8 File Offset: 0x000361D8 public unsafe override float GetFloat(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 4) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } float num; for (int i = 0; i < 4; i++) { *((ref num) + (3 - i)) = data[index + i]; } return num; } // Token: 0x06000C52 RID: 3154 RVA: 0x00038040 File Offset: 0x00036240 public unsafe override int GetInt32(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 4) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } int num; for (int i = 0; i < 4; i++) { *((ref num) + (3 - i)) = data[index + i]; } return num; } // Token: 0x06000C53 RID: 3155 RVA: 0x000380A8 File Offset: 0x000362A8 public unsafe override uint GetUInt32(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 4) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } uint num; for (int i = 0; i < 4; i++) { *((ref num) + (3 - i)) = data[index + i]; } return num; } // Token: 0x06000C54 RID: 3156 RVA: 0x00038110 File Offset: 0x00036310 public unsafe override short GetInt16(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 2) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } short num; for (int i = 0; i < 2; i++) { *((ref num) + (1 - i)) = data[index + i]; } return num; } // Token: 0x06000C55 RID: 3157 RVA: 0x00038178 File Offset: 0x00036378 public unsafe override ushort GetUInt16(byte[] data, int index) { if (data == null) { throw new ArgumentNullException("data"); } if (data.Length - index < 2) { throw new ArgumentException("index"); } if (index < 0) { throw new ArgumentException("index"); } ushort num; for (int i = 0; i < 2; i++) { *((ref num) + (1 - i)) = data[index + i]; } return num; } // Token: 0x06000C56 RID: 3158 RVA: 0x000381E0 File Offset: 0x000363E0 public unsafe override void PutBytes(byte[] dest, int destIdx, double value) { base.Check(dest, destIdx, 8); fixed (byte* ptr = &dest[destIdx]) { for (int i = 0; i < 8; i++) { ptr[i] = *((ref value) + (7 - i)); } } } // Token: 0x06000C57 RID: 3159 RVA: 0x00038220 File Offset: 0x00036420 public unsafe override void PutBytes(byte[] dest, int destIdx, float value) { base.Check(dest, destIdx, 4); fixed (byte* ptr = &dest[destIdx]) { for (int i = 0; i < 4; i++) { ptr[i] = *((ref value) + (3 - i)); } } } // Token: 0x06000C58 RID: 3160 RVA: 0x00038260 File Offset: 0x00036460 public unsafe override void PutBytes(byte[] dest, int destIdx, int value) { base.Check(dest, destIdx, 4); fixed (byte* ptr = &dest[destIdx]) { for (int i = 0; i < 4; i++) { ptr[i] = *((ref value) + (3 - i)); } } } // Token: 0x06000C59 RID: 3161 RVA: 0x000382A0 File Offset: 0x000364A0 public unsafe override void PutBytes(byte[] dest, int destIdx, uint value) { base.Check(dest, destIdx, 4); fixed (byte* ptr = &dest[destIdx]) { for (int i = 0; i < 4; i++) { ptr[i] = *((ref value) + (3 - i)); } } } // Token: 0x06000C5A RID: 3162 RVA: 0x000382E0 File Offset: 0x000364E0 public unsafe override void PutBytes(byte[] dest, int destIdx, long value) { base.Check(dest, destIdx, 8); fixed (byte* ptr = &dest[destIdx]) { for (int i = 0; i < 8; i++) { ptr[i] = *((ref value) + (7 - i)); } } } // Token: 0x06000C5B RID: 3163 RVA: 0x00038320 File Offset: 0x00036520 public unsafe override void PutBytes(byte[] dest, int destIdx, ulong value) { base.Check(dest, destIdx, 8); fixed (byte* ptr = &dest[destIdx]) { for (int i = 0; i < 4; i++) { ptr[i] = *((ref value) + (7 - i)); } } } // Token: 0x06000C5C RID: 3164 RVA: 0x00038360 File Offset: 0x00036560 public unsafe override void PutBytes(byte[] dest, int destIdx, short value) { base.Check(dest, destIdx, 2); fixed (byte* ptr = &dest[destIdx]) { for (int i = 0; i < 2; i++) { ptr[i] = *((ref value) + (1 - i)); } } } // Token: 0x06000C5D RID: 3165 RVA: 0x000383A0 File Offset: 0x000365A0 public unsafe override void PutBytes(byte[] dest, int destIdx, ushort value) { base.Check(dest, destIdx, 2); fixed (byte* ptr = &dest[destIdx]) { for (int i = 0; i < 2; i++) { ptr[i] = *((ref value) + (1 - i)); } } } } } }