GetBytes() public static method

public static GetBytes ( Int16 value ) : byte[]
value System.Int16
return byte[]
Example #1
0
 public void ToByteArray(byte[] buffer, int offset)
 {
     Buffer.BlockCopy(Bits.GetBytes(this.part4), 0, buffer, 0 + offset, 8);
     Buffer.BlockCopy(Bits.GetBytes(this.part3), 0, buffer, 8 + offset, 8);
     Buffer.BlockCopy(Bits.GetBytes(this.part2), 0, buffer, 16 + offset, 8);
     Buffer.BlockCopy(Bits.GetBytes(this.part1), 0, buffer, 24 + offset, 8);
 }
Example #2
0
 public UInt256(long value)
     : this(Bits.GetBytes(value))
 {
     if (value < 0)
     {
         throw new ArgumentOutOfRangeException();
     }
 }
Example #3
0
        public byte[] ToByteArray()
        {
            var buffer = new byte[32];

            Buffer.BlockCopy(Bits.GetBytes(this.part4), 0, buffer, 0, 8);
            Buffer.BlockCopy(Bits.GetBytes(this.part3), 0, buffer, 8, 8);
            Buffer.BlockCopy(Bits.GetBytes(this.part2), 0, buffer, 16, 8);
            Buffer.BlockCopy(Bits.GetBytes(this.part1), 0, buffer, 24, 8);

            return(buffer);
        }
Example #4
0
 public UInt256(uint value)
     : this(Bits.GetBytes(value))
 {
 }
Example #5
0
 public UInt256(ulong value)
     : this(Bits.GetBytes(value))
 {
 }