Beispiel #1
0
        public override void Write(float value)
        {
            uint value32 = BitConverterExtensions.ToUInt32(value);

            FillInnerBuffer(value32);
            Write(m_buffer, 0, sizeof(float));
        }
Beispiel #2
0
        public void WriteArray(float[] buffer, int index, int count)
        {
            FillInnerBuffer(count);
            Write(m_buffer, 0, sizeof(int));

            int byteIndex = 0;
            int byteCount = count * sizeof(float);
            int last      = index + count;

            while (index < last)
            {
                int left    = byteCount - byteIndex;
                int toWrite = left < BufferSize ? left : BufferSize;
                for (int i = 0; i < toWrite; i += sizeof(float), index++)
                {
                    FillInnerBuffer(BitConverterExtensions.ToUInt32(buffer[index]), i);
                }
                Write(m_buffer, 0, toWrite);
                byteIndex += toWrite;
            }
            if (IsAlignArray)
            {
                AlignStream();
            }
        }
 public static StringBuilder AppendHex(this StringBuilder _this, float value)
 {
     return(AppendHex(_this, BitConverterExtensions.ToUInt32(value)));
 }