public void grabValueFromData2(IndexedInfo par, Int64 end) { if (useValue) { Byte[] subBytes = { indexBytes[1], indexBytes[2], indexBytes[3] }; // value = subBytes.ToArray(); return; } List <Byte> bList = new List <byte>(); for (int j = par.bodyProg; par.endpointsIndex < par.endpoints.Count && j < par.endpoints[par.endpointsIndex]; j++) { try { bList.Add(par.body[j]); } catch (ArgumentOutOfRangeException ae) { // Console.WriteLine(j + " !" + par.endpoints[par.endpointsIndex]); } par.bodyProg++; } par.endpointsIndex++; value = bList.ToArray(); }
public void grabValueFromData(IndexedInfo par, Int64 end) { if (useValue) { Byte[] subBytes = { indexBytes[1], indexBytes[2], indexBytes[3] }; value = subBytes.ToArray(); } else { if (end == -999) { end = par.body.Length - par.bodyProg; } try { value = new Byte[10]; } catch (Exception eee) {} int i; int j = 0; for (i = par.bodyProg; i < par.body.Length; j++, i++) { // Console.WriteLine( i+" Bounds of arr " + value.Length); try { value[j] = par.body[i]; } catch (Exception eeee) { continue; } } par.bodyProg += i; } }
public void readIn(BinaryReader b) { objPlace = b.BaseStream.Position; IndexedInfo idex = new IndexedInfo(b); //Console.WriteLine("Prado you "+ idex.objectMarker + ":" + idex.lengthOfBody); // foreach (Byte key in idex.recordStore.Keys) // { // Console.WriteLine(key + " KEY"); // } // for (byte i = 0; i < 30; i++) //{ // Console.WriteLine(i + ": " + idex.getValueAsHexStr(i)); // Console.WriteLine(i + ": " + idex.getValueAsString(i)); // } senderMailAddress = idex.getValueAsString(14); recvAddress = idex.getValueAsString(19); subjectLine = idex.getValueAsString(8); dtf = DateTime.FromFileTimeUtc(BitConverter.ToInt64(idex.getValueAsArray(2), 0)); // Console.WriteLine(); try { if (idex.recordStore.ContainsKey(132)) msgPointer = BitConverter.ToInt32(idex.getValueAsArray(132).Reverse().ToArray(), 0); else { msgPointer = BitConverter.ToInt32(idex.getValueAsArray(4), 0); // Console.WriteLine("URGENT " + BitConverter.ToString(idex.getValueAsArray(4)) + "-" + BitConverter.ToInt32(idex.getValueAsArray(4),0).ToString()); } } catch (Exception eeeee) { } // Console.WriteLine("OBJPOINT " + objPlace); // Console.WriteLine("FROM " + idex.getValueAsString(14)); // Console.WriteLine("TO " + idex.getValueAsString(19)); // Console.WriteLine("SUBJECT " + idex.getValueAsString(8)); // Console.WriteLine("POINTER " + msgPointer.ToString()); // mainVein = new MessageNode(); /* */ // Console.WriteLine(mainVein.runningText); /* try //{ // BitConverter.ToString(idex.getValueAsArray(132))); byte[] brah = { 0, 1, 0x5c, 0x44}; brah = brah.Reverse().ToArray(); Console.WriteLine(BitConverter.ToInt32(brah,0).ToString()); } catch (Exception eeee) { } idex.findKey(0); */ Program.messages.Add(this); Program.mCount++; }