public override int Deserialize(System.Byte[] serialized, int startIndex)
 {
     int curIndex = startIndex;
     System.UInt32 CompressedMessageData_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(CompressedMessageData_len).Length;
     System.Byte[] temp = new System.Byte[CompressedMessageData_len];
     Array.Copy(serialized, curIndex, temp, 0, CompressedMessageData_len);
     CompressedMessageData = temp.ToList();
     curIndex += (int)CompressedMessageData_len;
     return (curIndex - startIndex);
 }
예제 #2
0
 public override int Deserialize(System.Byte[] serialized, int startIndex)
 {
     int curIndex = startIndex;
     curIndex += layout.Deserialize(serialized, curIndex);
     System.UInt32 data_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(data_len).Length;
     System.Byte[] temp = new System.Byte[data_len];
     Array.Copy(serialized, curIndex, temp, 0, data_len);
     data = temp.ToList();
     curIndex += (int)data_len;
     return (curIndex - startIndex);
 }
예제 #3
0
 public override int Deserialize(System.Byte[] serialized, int startIndex)
 {
     int curIndex = startIndex;
     curIndex += header.Deserialize(serialized, curIndex);
     System.UInt32 format_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(format_len).Length;
     format = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)format_len);
     curIndex += (int)format_len;
     System.UInt32 data_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(data_len).Length;
     System.Byte[] temp = new System.Byte[data_len];
     Array.Copy(serialized, curIndex, temp, 0, data_len);
     data = temp.ToList();
     curIndex += (int)data_len;
     return (curIndex - startIndex);
 }
 public override int Deserialize(System.Byte[] serialized, int startIndex)
 {
     int curIndex = startIndex;
     System.UInt32 TopicName_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(TopicName_len).Length;
     TopicName = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)TopicName_len);
     curIndex += (int)TopicName_len;
     System.UInt32 TopicType_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(TopicType_len).Length;
     TopicType = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)TopicType_len);
     curIndex += (int)TopicType_len;
     System.UInt32 SerializedMessageData_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(SerializedMessageData_len).Length;
     System.Byte[] temp = new System.Byte[SerializedMessageData_len];
     Array.Copy(serialized, curIndex, temp, 0, SerializedMessageData_len);
     SerializedMessageData = temp.ToList();
     curIndex += (int)SerializedMessageData_len;
     return (curIndex - startIndex);
 }
 public override int Deserialize(System.Byte[] serialized, int startIndex)
 {
     int curIndex = startIndex;
     curIndex += header.Deserialize(serialized, curIndex);
     height = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(height).Length;
     width = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(width).Length;
     System.UInt32 fields_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(fields_len).Length;
     for (int i = 0; i < (int)fields_len; i++)
     {
         sensor_msgs.PointField element = new sensor_msgs.PointField();
         curIndex += element.Deserialize(serialized, curIndex);
         fields.Add(element);
     }
     is_bigendian = Convert.ToBoolean(serialized[curIndex]);
     curIndex++;
     point_step = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(point_step).Length;
     row_step = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(row_step).Length;
     compression_type = serialized[curIndex];
     curIndex++;
     System.UInt32 compressed_data_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(compressed_data_len).Length;
     System.Byte[] temp = new System.Byte[compressed_data_len];
     Array.Copy(serialized, curIndex, temp, 0, compressed_data_len);
     compressed_data = temp.ToList();
     curIndex += (int)compressed_data_len;
     is_dense = Convert.ToBoolean(serialized[curIndex]);
     curIndex++;
     return (curIndex - startIndex);
 }
예제 #6
0
파일: Image.cs 프로젝트: WPI-ARC/Kinect2ROS
 public override int Deserialize(System.Byte[] serialized, int startIndex)
 {
     int curIndex = startIndex;
     curIndex += header.Deserialize(serialized, curIndex);
     height = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(height).Length;
     width = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(width).Length;
     System.UInt32 encoding_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(encoding_len).Length;
     encoding = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)encoding_len);
     curIndex += (int)encoding_len;
     is_bigendian = serialized[curIndex];
     curIndex++;
     step = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(step).Length;
     System.UInt32 data_len = BitConverter.ToUInt32(serialized, curIndex);
     curIndex += BitConverter.GetBytes(data_len).Length;
     System.Byte[] temp = new System.Byte[data_len];
     Array.Copy(serialized, curIndex, temp, 0, data_len);
     data = temp.ToList();
     curIndex += (int)data_len;
     return (curIndex - startIndex);
 }