GetBytes() публичный статический Метод

public static GetBytes ( byte bytes, int startIndex, double value ) : void
bytes byte
startIndex int
value double
Результат void
Пример #1
0
 public void Put(ushort value)
 {
     if (_autoResize)
     {
         ResizeIfNeed(_position + 2);
     }
     FastBitConverter.GetBytes(_data, _position, value);
     _position += 2;
 }
Пример #2
0
 public void Put(ulong value)
 {
     if (_autoResize)
     {
         ResizeIfNeed(_position + 8);
     }
     FastBitConverter.GetBytes(_data, _position, value);
     _position += 8;
 }
Пример #3
0
 public void Put(float value)
 {
     if (_autoResize)
     {
         ResizeIfNeed(_position + 4);
     }
     FastBitConverter.GetBytes(_data, _position, value);
     _position += 4;
 }
Пример #4
0
 public void PutBytesWithLength(byte[] data)
 {
     if (_autoResize)
     {
         ResizeIfNeed(_position + data.Length + 4);
     }
     FastBitConverter.GetBytes(_data, _position, data.Length);
     Buffer.BlockCopy(data, 0, _data, _position + 4, data.Length);
     _position += data.Length + 4;
 }
Пример #5
0
 public void PutBytesWithLength(byte[] data, int offset, int length)
 {
     if (_autoResize)
     {
         ResizeIfNeed(_position + length + 4);
     }
     FastBitConverter.GetBytes(_data, _position, length);
     Buffer.BlockCopy(data, offset, _data, _position + 4, length);
     _position += length + 4;
 }
Пример #6
0
        private void PutArray(Array arr, int sz)
        {
            ushort length = arr == null ? (ushort)0 : (ushort)arr.Length;

            sz *= length;
            if (_autoResize)
            {
                ResizeIfNeed(_position + sz + 2);
            }
            FastBitConverter.GetBytes(_data, _position, length);
            if (arr != null)
            {
                Buffer.BlockCopy(arr, 0, _data, _position + 2, sz);
            }
            _position += sz + 2;
        }
Пример #7
0
 private void SetUInt64BE(int offset, ulong value)
 {
     FastBitConverter.GetBytes(Bytes, offset, SwapEndianness(value));
 }