ushort ByteToUShort(Byte val) { var ret = (ushort) (((float)val) / byte.MaxValue * ushort.MaxValue); return ret; }