public MsSubscribe(byte[] buf, int start, int end)
: base(buf, start, end) {
int ptr=buf[start+0]==1?start+4:start+2;
dup=(buf[ptr] & 0x80)!=0;
qualityOfService=(QoS)((buf[ptr] >>5) & 0x03);
topicIdType=(TopicIdType)(buf[ptr] & 0x03);
ptr++;
base.MessageId=(ushort)((buf[ptr++]<<8) | buf[ptr++]);
if(topicIdType==TopicIdType.PreDefined || topicIdType==TopicIdType.ShortName) {
topicId=(ushort)((buf[ptr++]<<8) | buf[ptr++]);
path=null;
} else if(topicIdType==TopicIdType.Normal) {
topicId=0;
path=enc.GetString(buf, ptr, _length+start-ptr);
if(string.IsNullOrEmpty(path)) {
throw new ArgumentException("empty path");
}
} else {
throw new ArgumentException("unknown MsSubscribe.topicIdType");
}
}
public override byte[] GetBytes() {