internal Msg(MsgArg arg, Subscription s, byte[] payload, long totalLen) { subject = arg.subject; sid = arg.sid; _reply = arg.reply; sub = s; if (arg.hdr > 0) { HeaderStatusReader hsr = new HeaderStatusReader(payload, arg.hdr); header = hsr.Header; status = hsr.Status; } // make a deep copy of the bytes for this message. long payloadLen = totalLen - arg.hdr; if (payloadLen > 0) { data = new byte[payloadLen]; Array.Copy(payload, arg.hdr, data, 0, (int)(totalLen - arg.hdr)); } else { data = Empty; } }
internal Msg(MsgArg arg, Subscription s, byte[] payload, long length) { this.subject = arg.subject; this.reply = arg.reply; this.sub = s; // make a deep copy of the bytes for this message. this.data = new byte[length]; Array.Copy(payload, this.data, length); }
internal Msg(MsgArg arg, Subscription s, byte[] payload, long length) { subject = arg.subject; reply = arg.reply; sub = s; // make a deep copy of the bytes for this message. if (length > 0) { data = new byte[length]; Array.Copy(payload, 0, data, 0, (int)length); } else { data = Empty; } }
internal Msg(MsgArg arg, Subscription s, byte[] payload, long totalLen) { subject = arg.subject; reply = arg.reply; sub = s; if (arg.hdr > 0) { header = new MsgHeader(payload, arg.hdr); } // make a deep copy of the bytes for this message. if (totalLen > 0) { data = new byte[totalLen]; Array.Copy(payload, (int)arg.hdr, data, 0, (int)(totalLen - arg.hdr)); } else { data = Empty; } }