Ejemplo n.º 1
0
        public override void Write(double value)
        {
            ulong value64 = BitConverterExtensions.ToUInt64(value);

            FillInnerBuffer(value64);
            Write(m_buffer, 0, sizeof(double));
        }
Ejemplo n.º 2
0
        public void WriteArray(double[] buffer, int index, int count)
        {
            FillInnerBuffer(count);
            Write(m_buffer, 0, sizeof(int));

            int byteIndex = 0;
            int byteCount = count * sizeof(double);
            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(double), index++)
                {
                    FillInnerBuffer(BitConverterExtensions.ToUInt64(buffer[index]), i);
                }
                Write(m_buffer, 0, toWrite);
                byteIndex += toWrite;
            }
            if (IsAlignArray)
            {
                AlignStream();
            }
        }
Ejemplo n.º 3
0
 public static StringBuilder AppendHex(this StringBuilder _this, double value)
 {
     return(AppendHex(_this, BitConverterExtensions.ToUInt64(value)));
 }