GetBytes() public static method

public static GetBytes ( Int16 value ) : byte[]
value System.Int16
return byte[]
Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public UInt256(long value)
     : this(Bits.GetBytes(value))
 {
     if (value < 0)
     {
         throw new ArgumentOutOfRangeException();
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public UInt256(uint value)
     : this(Bits.GetBytes(value))
 {
 }
Ejemplo n.º 5
0
 public UInt256(ulong value)
     : this(Bits.GetBytes(value))
 {
 }