Пример #1
0
 public override byte[] ToBytes()
 {
     byte[] b    = ConvertBytes.HostToNetwork((uint)value);
     byte[] bout = new byte[BaseTypeLength];
     Array.Copy(b, 4 - BaseTypeLength, bout, 0, bout.Length);
     return(bout);
 }
Пример #2
0
        public override byte[] ToBytes()
        {
            double x = (value + offset) / scale;

            if (x > UInt16.MaxValue)
            {
                x = UInt16.MaxValue;
            }
            if (x < UInt16.MinValue)
            {
                x = UInt16.MinValue;
            }
            return(ConvertBytes.HostToNetwork((UInt16)x));
        }
Пример #3
0
 /// <summary>
 /// Convert a double to a byte stream
 /// </summary>
 /// <returns></returns>
 public override byte[] ToBytes()
 {
     return(ConvertBytes.HostToNetwork(value));
 }