ReadBytes() private static method

private static ReadBytes ( StreamReader ip ) : byte[]
ip System.IO.StreamReader
return byte[]
        public static CalibrationInfo[] GetList()
        {
            ArrayList arrayList = new ArrayList();
            string    path      = Path.Combine(Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]), "calibration.cfg");

            if (File.Exists(path))
            {
                using (StreamReader ip = new StreamReader(path))
                {
                    string str;
                    while ((str = ip.ReadLine()) != null)
                    {
                        byte[] mask;
                        byte[] vals;
                        byte[] detx;
                        byte[] dety;
                        byte[] detz;
                        byte[] detf;
                        if (str.Trim().ToLower() == "Begin" && (mask = CalibrationInfo.ReadBytes(ip)) != null && ((vals = CalibrationInfo.ReadBytes(ip)) != null && (detx = CalibrationInfo.ReadBytes(ip)) != null) && ((dety = CalibrationInfo.ReadBytes(ip)) != null && (detz = CalibrationInfo.ReadBytes(ip)) != null && (detf = CalibrationInfo.ReadBytes(ip)) != null))
                        {
                            arrayList.Add((object)new CalibrationInfo(mask, vals, detx, dety, detz, detf));
                        }
                    }
                }
            }
            arrayList.AddRange((ICollection)CalibrationInfo.DefaultList);
            return((CalibrationInfo[])arrayList.ToArray(typeof(CalibrationInfo)));
        }
        public static CalibrationInfo[] GetList()
        {
            ArrayList arrayLists    = new ArrayList();
            string    directoryName = Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]);

            directoryName = Path.Combine(directoryName, "calibration.cfg");
            if (File.Exists(directoryName))
            {
                using (StreamReader streamReader = new StreamReader(directoryName))
                {
                    while (true)
                    {
                        string str  = streamReader.ReadLine();
                        string str1 = str;
                        if (str == null)
                        {
                            break;
                        }
                        str1 = str1.Trim();
                        if (str1.ToLower() == "Begin")
                        {
                            byte[] numArray  = CalibrationInfo.ReadBytes(streamReader);
                            byte[] numArray1 = numArray;
                            if (numArray != null)
                            {
                                byte[] numArray2 = CalibrationInfo.ReadBytes(streamReader);
                                byte[] numArray3 = numArray2;
                                if (numArray2 != null)
                                {
                                    byte[] numArray4 = CalibrationInfo.ReadBytes(streamReader);
                                    byte[] numArray5 = numArray4;
                                    if (numArray4 != null)
                                    {
                                        byte[] numArray6 = CalibrationInfo.ReadBytes(streamReader);
                                        byte[] numArray7 = numArray6;
                                        if (numArray6 != null)
                                        {
                                            byte[] numArray8 = CalibrationInfo.ReadBytes(streamReader);
                                            byte[] numArray9 = numArray8;
                                            if (numArray8 != null)
                                            {
                                                byte[] numArray10 = CalibrationInfo.ReadBytes(streamReader);
                                                byte[] numArray11 = numArray10;
                                                if (numArray10 != null)
                                                {
                                                    arrayLists.Add(new CalibrationInfo(numArray1, numArray3, numArray5, numArray7, numArray9, numArray11));
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            arrayLists.AddRange(CalibrationInfo.DefaultList);
            return((CalibrationInfo[])arrayLists.ToArray(typeof(CalibrationInfo)));
        }