public void readData(IDataInput din) { ElementSetId = din.readUTF(); DataLength = din.readInt(); DataBytes = new byte[DataLength]; din.readFully(DataBytes); }
public virtual void ReadExternal(IDataInput input) { List<byte> flags = ReadFlags(input); int bits = 0; for (int i = 0; i < flags.Count; i++) { byte flag = flags[i]; if (i == 0) { if ((flag & 0x01) != 0) Body = input.ReadObject(); if ((flag & 0x02) != 0) ClientId = (string)input.ReadObject(); if ((flag & 0x04) != 0) Destination = (string)input.ReadObject(); if ((flag & 0x08) != 0) Headers = input.ReadObject() as AsObject; if ((flag & 0x10) != 0) MessageId = (string)input.ReadObject(); if ((flag & 0x20) != 0) Timestamp = Convert.ToInt64(input.ReadObject()); if ((flag & 0x40) != 0) TimeToLive = Convert.ToInt64(input.ReadObject()); bits = 7; } else if (i == 1) { if ((flag & 0x01) != 0) { ClientIdBytes = ((ByteArray)input.ReadObject()); } if ((flag & 0x02) != 0) { MessageIdBytes = ((ByteArray)input.ReadObject()); } bits = 2; } ReadRemaining(input, flag, bits); } flags = ReadFlags(input); for (int i = 0; i < flags.Count; i++) { byte flag = flags[i]; bits = 0; if (i == 0) { if ((flag & 0x01) != 0) CorrelationId = (string)input.ReadObject(); if ((flag & 0x02) != 0) { CorrelationIdBytes = ((ByteArray)input.ReadObject()); } bits = 2; } ReadRemaining(input, flag, bits); } }
public override void ReadExternal(IDataInput input) { base.ReadExternal(input); var flags = ReadFlags(input); for (int i = 0; i < flags.Count; i++) { ReadRemaining(input, flags[i], 0); } }
public void ReadExternal(IDataInput input) { Json = input.ReadUtf((int) input.ReadUInt32()); var json = JSONParser.ParseObject(Json, 0); if (json.ContainsKey("broadcastMessages")) { BroadcastMessages = JSONDeserializer.Deserialize<List<BroadcastMessage>>(json["broadcastMessages"]); } }
/// <summary> /// Constructor for the <see cref="MultiTrie"/> object. /// </summary> /// <param name="is">the input stream</param> /// <exception cref="IOException">if an I/O error occurs</exception> public MultiTrie(IDataInput @is) : base(false) { forward = @is.ReadBoolean(); BY = @is.ReadInt(); for (int i = @is.ReadInt(); i > 0; i--) { tries.Add(new Trie(@is)); } }
public void ReadExternal(IDataInput input) { string json = input.ReadUTF(); //DataContractJsonSerializer serialiser = new System.Runtime.Serialization.Json.DataContractJsonSerializer(typeof(BroadcastNotification)); //Stream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(json)); //BroadcastNotification notification = (BroadcastNotification)serialiser.ReadObject(stream); broadcastMessages = new ArrayCollection() ; }
public virtual void ReadExternal(IDataInput input) { var flags = ReadFlags(input); for (int i = 0; i < flags.Count; i++) { int bits = 0; if (i == 0) { if ((flags[i] & BODY_FLAG) != 0) { Body = input.ReadObject(); } if ((flags[i] & CLIENT_ID_FLAG) != 0) { ClientId = input.ReadObject() as string; } if ((flags[i] & DESTINATION_FLAG) != 0) { Destination = input.ReadObject() as string; } if ((flags[i] & HEADERS_FLAG) != 0) { Headers = input.ReadObject(); } if ((flags[i] & MESSAGE_ID_FLAG) != 0) { MessageId = input.ReadObject() as string; } if ((flags[i] & TIMESTAMP_FLAG) != 0) { TimeStamp = Convert.ToInt64(input.ReadObject()); } if ((flags[i] & TIME_TO_LIVE_FLAG) != 0) { TimeToLive = Convert.ToInt64(input.ReadObject()); } bits = 7; } else if (i == 1) { if ((flags[i] & CLIENT_ID_BYTES_FLAG) != 0) { ClientIdBytes = input.ReadObject() as ByteArray; ClientId = RtmpUtil.FromByteArray(ClientIdBytes); } if ((flags[i] & MESSAGE_ID_BYTES_FLAG) != 0) { MessageIdBytes = input.ReadObject() as ByteArray; MessageId = RtmpUtil.FromByteArray(MessageIdBytes); } bits = 2; } ReadRemaining(input, flags[i], bits); } }
public void ReadExternal(IDataInput input) { int size = input.ReadByte() << 24 | input.ReadByte() << 16 | input.ReadByte() << 8 | input.ReadByte(); string json=Encoding.UTF8.GetString(input.ReadBytes(size)); Dictionary<string,object> d=Serializer.Deserialize<Dictionary<string,object>>(json); foreach (var kv in d) { this[kv.Key] = kv.Value; } }
/// <summary> /// Construct a <see cref="Row"/> object from input carried in via the given input stream. /// </summary> /// <param name="@is">the input stream</param> /// <exception cref="IOException">if an I/O error occurs</exception> public Row(IDataInput @is) { for (int i = @is.ReadInt(); i > 0; i--) { char ch = @is.ReadChar(); Cell c = new Cell(); c.cmd = @is.ReadInt(); c.cnt = @is.ReadInt(); c.@ref = @is.ReadInt(); c.skip = @is.ReadInt(); cells[ch] = c; } }
public void ReadExternal(IDataInput input) { Json = input.ReadUtf((int)input.ReadUInt32()); JavaScriptSerializer serializer = new JavaScriptSerializer(); Dictionary<string, object> deserializedJSON = serializer.Deserialize<Dictionary<string, object>>(Json); Type classType = typeof(BroadcastNotification); foreach (KeyValuePair<string, object> keyPair in deserializedJSON) { var f = classType.GetProperty(keyPair.Key); f.SetValue(this, keyPair.Value); } }
public override void ReadExternal(IDataInput input) { base.ReadExternal(input); var flags = ReadFlags(input); for (int i = 0; i < flags.Count; i++) { int bits = 0; if (i == 0) { if ((flags[i] & OPERATION_FLAG) != 0) { SetOperation((uint)input.ReadObject()); } bits = 1; } ReadRemaining(input, flags[i], bits); } }
public new void ReadExternal(IDataInput input) { base.ReadExternal(input); short[] flagsArray = ReadFlags(input); for (int i = 0; i < flagsArray.Length; i++) { short flags = flagsArray[i]; short reservedPosition = 0; if (i == 0) { if ((flags & CORRELATION_ID_FLAG) != 0) correlationId = Convert.ToString(input.ReadObject()); if ((flags & CORRELATION_ID_BYTES_FLAG) != 0) { var obj = input.ReadObject(); if (obj is ByteArray) { correlationIdBytes = (obj as ByteArray).ToArray(); } else { throw new InvalidCastException("AMF object is not ByteArray type cant convert to byte array."); } correlationId = new Guid(correlationIdBytes).ToString(); } reservedPosition = 2; } // For forwards compatibility, read in any other flagged objects // to preserve the integrity of the input stream... if ((flags >> reservedPosition) != 0) { for (short j = reservedPosition; j < 6; j++) { if (((flags >> j) & 1) != 0) input.ReadObject(); } } } }
public override void ReadExternal(IDataInput input) { base.ReadExternal(input); var flags = ReadFlags(input); for (int i = 0; i < flags.Count; i++) { int bits = 0; if (i == 0) { if ((flags[i] & CORRELATION_ID_FLAG) != 0) { CorrelationId = input.ReadObject() as string; } if ((flags[i] & CORRELATION_ID_BYTES_FLAG) != 0) { CorrelationId = RtmpUtil.FromByteArray(input.ReadObject() as ByteArray); } bits = 2; } ReadRemaining(input, flags[i], bits); } }
protected List<byte> ReadFlags(IDataInput input) { List<byte> flags = new List<byte>(); byte flag; do { flag = input.ReadByte(); flags.Add(flag); } while ((flag & 0x80) != 0); return flags; }
public void ReadExternal(IDataInput input) { Json = input.ReadUTFBytes(input.ReadUnsignedInt()); }
public void Read(IDataInput param1, ICommandLookup lookup) { this.icon = param1.ReadShort(); param1.ReadShort(); }
public void Read(IDataInput param1, ICommandLookup lookup) { param1.ReadShort(); this.var_407 = param1.ReadBoolean(); }
public static char ReadUtf8Char(IDataInput input, byte firstByte) { var b = firstByte & 0xFF; switch (b >> 4) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: return (char) b; case 12: case 13: var first = (b & 0x1F) << 6; var second = input.ReadByte() & 0x3F; return (char) (first | second); case 14: var first2 = (b & 0x0F) << 12; var second2 = (input.ReadByte() & 0x3F) << 6; var third2 = input.ReadByte() & 0x3F; return (char) (first2 | second2 | third2); default: throw new InvalidDataException("Malformed byte sequence"); } }
PartFlags[] ReadFlags(IDataInput input) { IList<PartFlags> flags = new List<PartFlags>(); while (true) { PartFlags flag = (PartFlags)input.ReadByte(); flags.Add(flag); if ((flag & PartFlags.HAS_NEXT_FLAG) == 0) break; } return flags.ToArray(); }
public void ReadExternal(IDataInput input) { Json = input.ReadUtf((int)input.ReadUInt32()); JavaScriptSerializer serializer = new JavaScriptSerializer(); Dictionary<string, object> deserializedJSON = serializer.Deserialize<Dictionary<string, object>>(Json); Type classType = typeof(ClientSystemStatesNotification); foreach (KeyValuePair<string, object> keyPair in deserializedJSON) { var f = classType.GetProperty(keyPair.Key); if (f == null) { Client.Log("New Client System State: " + keyPair.Key); continue; } if (keyPair.Value.GetType() == typeof(ArrayList)) { ArrayList tempArrayList = keyPair.Value as ArrayList; if (tempArrayList.Count > 0) f.SetValue(this, tempArrayList.ToArray(f.PropertyType.GetElementType())); else f.SetValue(this, null); } else { f.SetValue(this, keyPair.Value); } } }
/// <summary> /// Decode the ArrayCollection from a data stream. /// </summary> /// <param name="input">IDataInput interface.</param> public void ReadExternal(IDataInput input) { _list = input.ReadObject() as IList; }
/// <summary> /// Constructor for the <see cref="MultiTrie"/> object. /// </summary> /// <param name="is">the input stream</param> /// <exception cref="IOException">if an I/O error occurs</exception> public MultiTrie2(IDataInput @is) : base(@is) { }
public void Read(IDataInput param1, ICommandLookup lookup) { this.var_2243 = param1.ReadInt(); this.var_2243 = param1.Shift(this.var_2243, 26); param1.ReadShort(); }
public DbParameters Put(string name, IDataInput v) { return(this); }
public DbParameters Set(IDataInput v) { return(Put(null, v)); }
public void Read(IDataInput param1, ICommandLookup lookup) { this.typeValue = param1.ReadShort(); }
public void Read(IDataInput param1, ICommandLookup lookup) { this.uid = param1.ReadInt(); this.uid = param1.Shift(this.uid, 13); }
public void Read(IDataInput param1, ICommandLookup lookup) { this.var_3378 = param1.ReadInt(); this.var_3378 = param1.Shift(this.var_3378, 3); }
public override void Read(IDataInput param1, ICommandLookup lookup) { base.Read(param1, lookup); param1.ReadShort(); this.var_3461 = param1.ReadDouble(); }
private void ProcessAcknowledgeMessage(IDataInput input) { var flags2 = ReadFlags(input); for (int idx = 0; idx < flags2.Length; idx++) { var flag2 = flags2[idx]; int x = 0; if (((uint)flag2 >> x) != 0) { int y = x; while (y < 6) { if ((((uint)flag2 >> y) & 0x1) != 0) { input.ReadObject(); } y++; } } } }
public void Read(IDataInput param1, ICommandLookup lookup) { this.var_2222 = param1.ReadInt(); this.var_2222 = param1.Shift(this.var_2222, 19); }
/// <summary> /// Constructor for the <see cref="Trie"/> object. /// </summary> /// <param name="is">the input stream</param> /// <exception cref="IOException">if an I/O error occurs</exception> public Trie(IDataInput @is) { forward = @is.ReadBoolean(); root = @is.ReadInt(); for (int i = @is.ReadInt(); i > 0; i--) { cmds.Add(@is.ReadUTF()); } for (int i = @is.ReadInt(); i > 0; i--) { rows.Add(new Row(@is)); } }
public void Read(IDataInput param1, ICommandLookup lookup) { this.value = param1.ReadUTF(); this.key = param1.ReadShort(); }
public void ReadExternal(IDataInput input) { Json = input.ReadInt32(); this.Data = JObject.Parse(input.ReadUtf(Json)); }
public void Read(IDataInput param1, ICommandLookup lookup) { this.active = param1.ReadBoolean(); this.var_372 = lookup.Lookup(param1) as PetGearTypeModule; this.var_372.Read(param1, lookup); }
public FormMpContent Put(string name, IDataInput v) { return(this); }
public void Read(IDataInput param1, ICommandLookup lookup) { this.var_1574 = param1.ReadInt(); this.var_1574 = param1.Shift(this.var_1574, 23); param1.ReadShort(); }
public void Read(IDataInput param1, ICommandLookup lookup) { this.var_1887 = param1.ReadUTF(); param1.ReadShort(); param1.ReadShort(); }
// Filtering the Question from Feature dictionary and Storing the Option in Answer Dictionary using DB public Dictionary <int, string> ProcessChatbotFeatures(IDataInput dataInput, Dictionary <int, string> FeaturesDictionary) { List <string> SelectedItems; using (ChatbotModalDataContext dbcontext = new ChatbotModalDataContext()) { //For Each Feature from 1st to Last Question for (int i = 1; i < FeaturesDictionary.Count() - 1; i++) { string input = ""; var list = new List <string>(); //For First Question Reading if (i == 1) { var Options = dbcontext.ChatbotTable_s.Where(FeaturesDictionary[i] + "!=\"" + null + "\"").Select(FeaturesDictionary[i]).Distinct(); if (Options.Count() > 0) { foreach (var option in Options) { list.Add(option.ToString()); } if (list.Contains("true") || list.Contains("false")) { Console.WriteLine("Do you want '{0}' ?", FeaturesDictionary[i].ToUpper()); } else { Console.WriteLine("Choose from the following '{0}' options:", FeaturesDictionary[i].ToUpper()); } int index = 0; foreach (var option in Options) { Console.Write("{0}: ", ++index); Console.WriteLine(option); } Console.Write("{0}: {1}\n{2}: {3}\n{4}: {5}\n", ++index, DefaultFeatures.Display_Filtered_Items.ToString().Replace('_', ' '), ++index, DefaultFeatures.Start_Again.ToString().Replace('_', ' '), ++index, DefaultFeatures.Exit_the_Application.ToString().Replace('_', ' ')); bool valid = false; int option_choosen = 0; while (valid == false) { input = dataInput.getInput(); if (int.TryParse(input, out option_choosen)) { if (option_choosen > 0 && option_choosen <= index) { valid = true; } else { Console.WriteLine("!!!! Choose the Valid Option !!!!\n"); } } else { Console.WriteLine("!!!! Choose the Valid Option !!!!\n"); } } //Display the Selected Items if (option_choosen == list.Count() + 1) { SelectedItems = SelectItems("FirstFeature", "FirstValue"); DisplayItems(SelectedItems); i = i - 1; } //Start Again from the Home else if (option_choosen == list.Count() + 2) { i = StartAgain(); } //Aborting the Application else if (option_choosen == list.Count() + 3) { ExitApplication(); //return null; } //Storing the option for next question else { AnswerDictionary.Add(i, list[option_choosen - 1]); } } } else { var Options = dbcontext.ChatbotTable_s.Where(FeaturesDictionary[feature_no] + "=\"" + AnswerDictionary[feature_no] + "\"").Where(FeaturesDictionary[i] + "!=\"" + null + "\"").Select(FeaturesDictionary[i]).Distinct(); if (Options.Count() > 0) { foreach (var option in Options) { list.Add(option.ToString()); } if (list.Contains("true") || list.Contains("false")) { Console.WriteLine("\nDo you want '{0}' ?", FeaturesDictionary[i].ToUpper()); } else { Console.WriteLine("\nChoose from the following '{0}' options:", FeaturesDictionary[i].ToUpper()); } int index = 0; foreach (var option in Options) { Console.Write("{0}: ", ++index); Console.WriteLine(option); } Console.Write("{0}: {1}\n{2}: {3}\n{4}: {5}\n{6}: {7}\n", ++index, DefaultFeatures.Display_Filtered_Items.ToString().Replace('_', ' '), ++index, DefaultFeatures.Start_Again.ToString().Replace('_', ' '), ++index, DefaultFeatures.Back_To_Previous_Question.ToString().Replace('_', ' '), ++index, DefaultFeatures.Exit_the_Application.ToString().Replace('_', ' ')); bool valid = false; int option_choosen = 0; while (valid == false) { input = dataInput.getInput(); if (int.TryParse(input, out option_choosen)) { if (option_choosen > 0 && option_choosen <= index) { valid = true; } else { Console.WriteLine("!!!! Please Choose the Valid Option !!!!\n"); } } else { Console.WriteLine("!!!! Please Choose the Valid Option !!!!\n"); } } //Display the Selected Items if (option_choosen == list.Count() + 1) { SelectedItems = SelectItems(FeaturesDictionary[feature_no], AnswerDictionary[feature_no]); DisplayItems(SelectedItems); i = i - 1; } //Start Again from the Home else if (option_choosen == list.Count() + 2) { i = StartAgain(); } //Back to the previous question else if (option_choosen == list.Count() + 3) { i = BackPropagation(feature_no); } //Aborting the Application else if (option_choosen == list.Count() + 4) { ExitApplication(); // return null; } //Storing the option for next question else { AnswerDictionary.Add(i, list[option_choosen - 1]); feature_no = i; } } } } SelectedItems = SelectItems(FeaturesDictionary[feature_no], AnswerDictionary[feature_no]); DisplayItems(SelectedItems); Console.WriteLine("\n---------------------------------!!!!! Thank you for your Interaction, Hope I was able to assist you here. !!!!!----------\n ---------------------------------------!!!!! HAVE A NICE DAY VISIT AGAIN !!!!!---------------------------------"); return(AnswerDictionary); } }
protected void ReadRemaining(IDataInput input, int flag, int bits) { // For forwards compatibility, read in any other flagged objects to // preserve the integrity of the input stream... if ((flag >> bits) != 0) { for (int o = bits; o < 6; o++) { if (((flag >> o) & 1) != 0) input.ReadObject(); } } }
public override void Read(IDataInput param1, ICommandLookup lookup) { base.Read(param1, lookup); this.value = param1.ReadUTF(); param1.ReadShort(); }
public static Vector3 ReadExternal(IDataInput input) { return(new Vector3(input.ReadFloat(), input.ReadFloat(), input.ReadFloat())); }
public void ReadExternal(IDataInput input) { string str = input.ReadUtf(input.ReadInt32()); this.broadcastMessages = JsonConvert.DeserializeObject <ArrayList>(str); }
public void readData(IDataInput din) { WebServiceId = din.readUTF(); QuantityId = din.readUTF(); ElementSetId = din.readUTF(); TimeStamp = din.readUTF(); ScenarioId = din.readUTF(); }
public void Read(IDataInput param1, ICommandLookup lookup) { }
public void Read(IDataInput param1, ICommandLookup lookup) { param1.ReadShort(); param1.ReadShort(); this.lootId = param1.ReadUTF(); }
private void ProcessAsyncMessage(IDataInput input) { var flags = ReadFlags(input); for (int idx = 0; idx < flags.Length; idx++) { var flag = (uint)flags[idx]; int x = 0; if (idx == 0) { //CORRELATION_ID_FLAG if ((flag & 0x1) != 0) { CorrelationId = input.ReadObject() as string; } // CORRELATION_ID_BYTES_FLAG if ((flag & 0x2) != 0) { correlationIdBytes = input.ReadObject() as ByteArray; CorrelationId = AmfMessageUtils.UIDBytesToString(correlationIdBytes.ToArray()); } x = 2; } if ((flag >> x) != 0) { int y = x; while (y < 6) { if (((flag >> y) & 0x1) != 0) { input.ReadObject(); } y++; } } } }
public override void Read(IDataInput param1, ICommandLookup lookup) { base.Read(param1, lookup); this.var_128 = param1.ReadFloat(); }
public void ReadExternal(IDataInput input) { // AbstractMessage int state; PartFlags[] flags = ReadFlags(input); for (int i = 0; i < flags.Length; i++) { state = 0; PartFlags flag = flags[i]; if (i == 0) { if ((flag & PartFlags.BODY_FLAG) != 0) { Body = input.ReadObject(); } else { Body = null; } if ((flag & PartFlags.CLIENT_ID_FLAG) != 0) ClientId = input.ReadObject() as string; if ((flag & PartFlags.DESTINATION_FLAG) != 0) Destination = input.ReadUtf(); if ((flag & PartFlags.HEADERS_FLAG) != 0) Headers = input.ReadObject() as Dictionary<string, object>; if ((flag & PartFlags.MESSAGE_ID_FLAG) != 0) MessageId = input.ReadUtf(); if ((flag & PartFlags.TIMESTAMP_FLAG) != 0) Timestamp = (long)(double)input.ReadObject(); if ((flag & PartFlags.TIME_TO_LIVE_FLAG) != 0) TimeToLive = (long)input.ReadObject(); state = 7; } else if (i == 1) { // clientidbytes if (((int)flag & 0x1) != 0) { clientIdBytes = input.ReadObject() as ByteArray; ClientId = AmfMessageUtils.UIDBytesToString(clientIdBytes.ToArray()); } // messageidbytes if (((int)flag & 0x2) != 0) { messageIdBytes = input.ReadObject() as ByteArray; MessageId = AmfMessageUtils.UIDBytesToString(messageIdBytes.ToArray()); } state = 2; } if (((uint)flag >> state) != 0) { int local6 = state; while (local6 < 6) { if ((((uint)flag >> local6) & 0x1) != 0) { input.ReadObject(); } local6++; } } } ProcessAsyncMessage(input); ProcessAcknowledgeMessage(input); }
public void Read(IDataInput param1, ICommandLookup lookup) { this.windowId = param1.ReadInt(); this.windowId = param1.Shift(this.windowId, 2); param1.ReadShort(); }
public void ReadExternal(IDataInput input) { Json = input.ReadUtf((int) input.ReadUInt32()); var json = JSONParser.ParseObject(Json, 0); var states = JSONDeserializer.Deserialize<ClientSystemStatesNotification>(json); foreach (PropertyInfo prop in typeof(ClientSystemStatesNotification).GetProperties()) { prop.SetValue(this, prop.GetValue(states)); } //foreach (KeyValuePair<string, object> keyPair in json) { // var f = typeof(ClientSystemStatesNotification).GetProperty(keyPair.Key); // if (f == null) continue; // if (keyPair.Value is MFroehlich.Parsing.JSON.JSONArray) { // var tempArrayList = keyPair.Value as MFroehlich.Parsing.JSON.JSONArray; // if (tempArrayList.Count > 0) { // var array = Array.CreateInstance(f.PropertyType.GetElementType(), tempArrayList.Count); // for (int i = 0; i < tempArrayList.Count; i++) array.SetValue(tempArrayList[i], i); // f.SetValue(this, array); // } else // f.SetValue(this, null); // } else { // f.SetValue(this, (dynamic) keyPair.Value); // } //} }
protected void ReadRemaining(IDataInput input, int flag, int bits) { if ((flag >> bits) != 0) { for (int o = bits; o < 6; o++) { if ((flag >> o & 1) != 0) { input.ReadObject(); } } } }
public void Read(IDataInput param1, ICommandLookup lookup) { this.var_5118 = param1.ReadShort(); }
public static List<byte> ReadFlags(IDataInput input) { var ret = new List<byte>(); byte read; do { ret.Add(read = input.ReadUnsignedByte()); } while ((read & HAS_NEXT_FLAG) != 0); //Highest bit reserved for declaring that there is another flag. return ret; }
public void Read(IDataInput param1, ICommandLookup lookup) { param1.ReadShort(); }
public override void Read(IDataInput param1, ICommandLookup lookup) { base.Read(param1, lookup); this.active = param1.ReadBoolean(); }