Exemple #1
0
		protected void ParseMutiPack(byte[] body)
		{
			ByteArray bin_buf = new ByteArray(body);
			
			byte num = 0;
			bin_buf.Get_(out num);
			
			for (int i=0; i<num; i++)
			{
				ushort sinle_pack_len = 0;
				bin_buf.Get_(out sinle_pack_len);
				
				byte[] buf = new byte[sinle_pack_len];
				Array.Copy(bin_buf.GetByteArray_(sinle_pack_len), buf, sinle_pack_len);
				
				ParseSinglePack(buf);
			}
			
			/* C++ code.
			bin_buf.get(num);
		
			for (int i=0; i<num; ++i)
			{
				USHORT single_pack_len = 0;
				bin_buf.get(single_pack_len);
		
				static std::vector<UCHAR> buf;
				buf.clear();
				buf.resize(single_pack_len);
				
				bin_buf.read(&buf[0], single_pack_len);
		
				ParseSinglePack(&buf[0], single_pack_len);
			}
			*/
		}