public void Write(byte[] buffer, int index, object value)
 {
     if (value is null)
     {
         BytesHelper.Fill(buffer, index, length, filler);
     }
     else
     {
         BytesHelper.CopyBytes(encoding.GetBytes((string)value), buffer, index, length, padding, filler);
     }
 }
 public void Write(byte[] buffer, int index, object value)
 {
     if (value is null)
     {
         BytesHelper.Fill(buffer, index, length, filler);
     }
     else
     {
         NumberByteHelper.FormatInt64(buffer, index, length, (long)value, padding, zerofill, filler);
     }
 }
 public void Write(byte[] buffer, int index, object value)
 {
     if (value is null)
     {
         BytesHelper.Fill(buffer, index, length, filler);
     }
     else
     {
         NumberByteHelper.FormatDecimal(buffer, index, length, (decimal)value, scale, groupingSize, padding, zerofill, filler);
     }
 }
Esempio n. 4
0
 public void Write(byte[] buffer, int index, object value)
 {
     if (value is null)
     {
         BytesHelper.Fill(buffer, index, length, filler);
     }
     else
     {
         DateTimeByteHelper.FormatDateTime(buffer, index, hasDatePart, entries, ((DateTimeOffset)value).UtcDateTime);
     }
 }
Esempio n. 5
0
 public void Write(byte[] buffer, int index, object value)
 {
     if (value is null)
     {
         BytesHelper.Fill(buffer, index, length, filler);
     }
     else
     {
         BytesHelper.CopyBytes(encoding.GetBytes(((int)value).ToString(format, provider)), buffer, index, length, padding, filler);
     }
 }
Esempio n. 6
0
 public void Write(byte[] buffer, int index, object value)
 {
     if (value is null)
     {
         BytesHelper.Fill(buffer, index, length, filler);
     }
     else
     {
         var bytes = (byte[])value;
         BytesHelper.CopyBytes(bytes, buffer, index, length, Padding.Right, filler);
     }
 }
Esempio n. 7
0
 public void Write(byte[] buffer, int index, object value)
 {
     if (value is null)
     {
         BytesHelper.Fill(buffer, index, length, filler);
     }
     else
     {
         var bytes = encoding.GetBytes(((DateTime)value).ToString(format, provider));
         BytesHelper.CopyBytes(bytes, buffer, index, length, Padding.Right, filler);
     }
 }
Esempio n. 8
0
 public void ToByte(byte[] buffer, int index, T target)
 {
     if (target == null)
     {
         BytesHelper.Fill(buffer, index, Size, filler);
     }
     else
     {
         for (var i = 0; i < writableMappers.Length; i++)
         {
             writableMappers[i].Write(buffer, index, target);
         }
     }
 }
        public void Write(byte[] buffer, int index, object value)
        {
            if (value is null)
            {
                BytesHelper.Fill(buffer, index, length * elementSize, filler);
            }
            else
            {
                var array = (Array)value;

                for (var i = 0; i < array.Length; i++)
                {
                    elementConverter.Write(buffer, index, array.GetValue(i));
                    index += elementSize;
                }

                if (array.Length < length)
                {
                    BytesHelper.Fill(buffer, index, (length - array.Length) * elementSize, filler);
                }
            }
        }
Esempio n. 10
0
 public void Write(byte[] buffer, int index, object target)
 {
     BytesHelper.Fill(buffer, index + offset, length, filler);
 }