GetBytes() public static method

Given a 32-bit IEEE single precision floating point number, returns four bytes encoding a single precision number in IBM System/360 Floating Point format
public static GetBytes ( System.Single value ) : byte[]
value System.Single
return byte[]
Beispiel #1
0
        /// <summary>
        /// Writes a packed decimal to the stream
        /// </summary>
        public static void WriteIbmPackedDecimal(this BinaryWriter writer, decimal value)
        {
            var bytes = IbmConverter.GetBytes(value);

            writer.Write(bytes);
        }
Beispiel #2
0
        /// <summary>
        /// Writes an IBM System/360 Floating Point encoded Single to the stream
        /// </summary>
        public static void WriteIbmSingle(this BinaryWriter writer, Single value)
        {
            var bytes = IbmConverter.GetBytes(value);

            writer.Write(bytes);
        }
Beispiel #3
0
        /// <summary>
        /// Writes the given Unicode string as an 8-bit EBCDIC encoded character string
        /// </summary>
        public static void WriteEbcdic(this BinaryWriter writer, string value)
        {
            var bytes = IbmConverter.GetBytes(value);

            writer.Write(bytes);
        }
Beispiel #4
0
        /// <summary>
        /// Writes a big endian encoded Int32 to the stream
        /// </summary>
        public static void WriteBigEndian(this BinaryWriter writer, Int32 value)
        {
            var bytes = IbmConverter.GetBytes(value);

            writer.Write(bytes);
        }
        /// <summary>
        /// Writes a big endian encoded Int32 to the stream
        /// </summary>
        public static void WriteBigEndian32FromSingle(this BinaryWriter writer, float value)
        {
            var bytes = IbmConverter.GetBytes((int)value);

            writer.Write(bytes);
        }