本文整理汇总了C#中System.Byte类的典型用法代码示例。如果您正苦于以下问题:C# System.Byte类的具体用法?C# System.Byte怎么用?C# System.Byte使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Byte类属于命名空间,在下文中一共展示了System.Byte类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override int Deserialize(System.Byte[] serialized, int startIndex)
{
int curIndex = startIndex;
data = serialized[curIndex];
curIndex++;
return (curIndex - startIndex);
}
示例2: Serialize
public override void Serialize(MemoryStream stream)
{
System.Byte[] type_bytes = new System.Byte[] {type};
stream.Write(type_bytes, 0, type_bytes.Length);
System.Byte[] id_bytes = new System.Byte[] {id};
stream.Write(id_bytes, 0, id_bytes.Length);
System.Byte[] intensity_bytes = BitConverter.GetBytes(intensity);
stream.Write(intensity_bytes, 0, intensity_bytes.Length);
}
示例3: Serialize
public override void Serialize(MemoryStream stream)
{
goal_id.Serialize(stream);
System.Byte[] status_bytes = new System.Byte[] {status};
stream.Write(status_bytes, 0, status_bytes.Length);
System.Byte[] text_bytes = System.Text.Encoding.UTF8.GetBytes(text);
System.Byte[] text_len_bytes = BitConverter.GetBytes((System.UInt32)text_bytes.Length);
stream.Write(text_len_bytes, 0, text_len_bytes.Length);
stream.Write(text_bytes, 0, text_bytes.Length);
}
示例4: Image
public Image()
{
header = new std_msgs.Header();
height = 0;
width = 0;
encoding = "";
is_bigendian = 0;
step = 0;
data = new List<System.Byte>();
}
示例5: Deserialize
public override int Deserialize(System.Byte[] serialized, int startIndex)
{
int curIndex = startIndex;
type = serialized[curIndex];
curIndex++;
id = serialized[curIndex];
curIndex++;
intensity = BitConverter.ToSingle(serialized, curIndex);
curIndex += BitConverter.GetBytes(intensity).Length;
return (curIndex - startIndex);
}
示例6: Deserialize
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);
}
示例7: Deserialize
public override int Deserialize(System.Byte[] serialized, int startIndex)
{
int curIndex = startIndex;
curIndex += goal_id.Deserialize(serialized, curIndex);
status = serialized[curIndex];
curIndex++;
System.UInt32 text_len = BitConverter.ToUInt32(serialized, curIndex);
curIndex += BitConverter.GetBytes(text_len).Length;
text = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)text_len);
curIndex += (int)text_len;
return (curIndex - startIndex);
}
示例8: Deserialize
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);
}
示例9: Serialize
public override void Serialize(MemoryStream stream)
{
System.Byte[] name_bytes = System.Text.Encoding.UTF8.GetBytes(name);
System.Byte[] name_len_bytes = BitConverter.GetBytes((System.UInt32)name_bytes.Length);
stream.Write(name_len_bytes, 0, name_len_bytes.Length);
stream.Write(name_bytes, 0, name_bytes.Length);
System.Byte[] offset_bytes = BitConverter.GetBytes(offset);
stream.Write(offset_bytes, 0, offset_bytes.Length);
System.Byte[] datatype_bytes = new System.Byte[] {datatype};
stream.Write(datatype_bytes, 0, datatype_bytes.Length);
System.Byte[] count_bytes = BitConverter.GetBytes(count);
stream.Write(count_bytes, 0, count_bytes.Length);
}
示例10: CompressedPointCloud2
public CompressedPointCloud2()
{
header = new std_msgs.Header();
height = 0;
width = 0;
fields = new List<sensor_msgs.PointField>();
is_bigendian = false;
point_step = 0;
row_step = 0;
compression_type = 0;
compressed_data = new List<System.Byte>();
is_dense = false;
}
示例11: Serialize
public override void Serialize(MemoryStream stream)
{
header.Serialize(stream);
System.Byte[] radiation_type_bytes = new System.Byte[] {radiation_type};
stream.Write(radiation_type_bytes, 0, radiation_type_bytes.Length);
System.Byte[] field_of_view_bytes = BitConverter.GetBytes(field_of_view);
stream.Write(field_of_view_bytes, 0, field_of_view_bytes.Length);
System.Byte[] min_range_bytes = BitConverter.GetBytes(min_range);
stream.Write(min_range_bytes, 0, min_range_bytes.Length);
System.Byte[] max_range_bytes = BitConverter.GetBytes(max_range);
stream.Write(max_range_bytes, 0, max_range_bytes.Length);
System.Byte[] range_bytes = BitConverter.GetBytes(range);
stream.Write(range_bytes, 0, range_bytes.Length);
}
示例12: Deserialize
public override int Deserialize(System.Byte[] serialized, int startIndex)
{
int curIndex = startIndex;
System.UInt32 name_len = BitConverter.ToUInt32(serialized, curIndex);
curIndex += BitConverter.GetBytes(name_len).Length;
name = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)name_len);
curIndex += (int)name_len;
offset = BitConverter.ToUInt32(serialized, curIndex);
curIndex += BitConverter.GetBytes(offset).Length;
datatype = serialized[curIndex];
curIndex++;
count = BitConverter.ToUInt32(serialized, curIndex);
curIndex += BitConverter.GetBytes(count).Length;
return (curIndex - startIndex);
}
示例13: Deserialize
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);
}
示例14: Deserialize
public override int Deserialize(System.Byte[] serialized, int startIndex)
{
int curIndex = startIndex;
curIndex += header.Deserialize(serialized, curIndex);
radiation_type = serialized[curIndex];
curIndex++;
field_of_view = BitConverter.ToSingle(serialized, curIndex);
curIndex += BitConverter.GetBytes(field_of_view).Length;
min_range = BitConverter.ToSingle(serialized, curIndex);
curIndex += BitConverter.GetBytes(min_range).Length;
max_range = BitConverter.ToSingle(serialized, curIndex);
curIndex += BitConverter.GetBytes(max_range).Length;
range = BitConverter.ToSingle(serialized, curIndex);
curIndex += BitConverter.GetBytes(range).Length;
return (curIndex - startIndex);
}
示例15: PointField
public PointField()
{
name = "";
offset = 0;
datatype = 0;
count = 0;
}