private CEnum.Body_Status initTLV() { uint size = 0; System.Collections.ArrayList bal = new System.Collections.ArrayList(), lenlist = new System.Collections.ArrayList(); for (int i = 0; i < this.m_uiTLVCnt; i++) { TLV_Structure tlv = (TLV_Structure)this.m_TLVList[i]; if (tlv.IsValidTLV) { size += tlv.m_uiValueLen + 4; bal.Add(tlv.ToByteArray()); lenlist.Add(tlv.m_uiValueLen + 4); } } this.m_uiBodyLen = size; this.m_bBodyBuffer = new byte[size]; for (int i = 0, index = 0; i < bal.Count; i++) { ((byte[])bal[i]).CopyTo(m_bBodyBuffer, index); index += (int)((uint)lenlist[i]); } return(CEnum.Body_Status.MSG_STRUCT_OK); }