private bool DeCodeOneWay(byte[] bytes, FPData data) { if (bytes.Length != data.GetSS() + data.GetPsize()) { return(false); } data.SetMethod(this.GetString(this.GetByteArrayRange(bytes, 0, data.GetSS() - 1))); if (this.IsJson(data)) { data.SetPayload(this.GetString(this.GetByteArrayRange(bytes, data.GetSS(), bytes.Length - 1))); } if (this.IsMsgPack(data)) { data.SetPayload(this.GetByteArrayRange(bytes, data.GetSS(), bytes.Length - 1)); } return(true); }
private bool DeCodeTwoWay(byte[] bytes, FPData data) { if (bytes.Length != 4 + data.GetSS() + data.GetPsize()) { return(false); } data.SetSeq((int)BitConverter.ToUInt32(this.GetByteArrayRange(bytes, 0, 3), 0)); data.SetMethod(this.GetString(this.GetByteArrayRange(bytes, 4, data.GetSS() + 4 - 1))); if (this.IsJson(data)) { data.SetPayload(this.GetString(this.GetByteArrayRange(bytes, 4 + data.GetSS(), bytes.Length - 1))); } if (this.IsMsgPack(data)) { data.SetPayload(this.GetByteArrayRange(bytes, 4 + data.GetSS(), bytes.Length - 1)); } return(true); }