private Object DecodeData(byte[] data, Object proxy) { _is.Wrap(data); _is.SetServerEncoding(_encodeName); Object obj = _is._Read(proxy, 0, true); return(obj); }
public void DecodeTup3(TarsInputStream inputStream, int Index = 0) { Version = Const.PacketTypeTup3; inputStream.SetServerEncoding(EncodeName); newData = new Dictionary <string, byte[]>(); inputStream.ReadMap <string, byte[]>(newData, 0, false); }
private object DecodeBuffer(byte[] buffer, Type type) { TarsInputStream tis = new TarsInputStream(buffer); tis.SetServerEncoding(EncodeName); var result = tis.Read(type, 0, true); return(result); }
internal void Decode(byte[] buffer) { TarsInputStream tis = new TarsInputStream(buffer); tis.SetServerEncoding(EncodeName); if (IsVersionTup3) { tis.ReadMap(newData, 0, false); } else { tis.ReadMap(data, 0, false); } }
/** * Decode incoming data, fill in getable objects. */ public new void Decode(byte[] buffer, int Index = 0) { if (buffer.Length < UniPacketHeadSize) { throw new ArgumentException("Decode namespace must include size head"); } try { TarsInputStream _is = new TarsInputStream(buffer, UniPacketHeadSize + Index); _is.SetServerEncoding(EncodeName); // Decode the RequestPacket package. this.ReadFrom(_is); // Set the tup version. _iVer = _package.iVersion; _is = new TarsInputStream(_package.sBuffer); _is.SetServerEncoding(EncodeName); if (_package.iVersion == Const.TUP_VERSION_2) { _data = (Dictionary <string, Dictionary <string, byte[]> >)_is.ReadMap < Dictionary <string, Dictionary <string, byte[]> > >(0, false); } else { _new_data = (Dictionary <string, byte[]>)_is.ReadMap <Dictionary <string, byte[]> >(0, false); } } catch (Exception ex) { QTrace.Trace(this + " Decode Exception: " + ex.Message); throw (ex); } }