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); }
public UInt256(long value) : this(Bits.GetBytes(value)) { if (value < 0) { throw new ArgumentOutOfRangeException(); } }
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); }
public UInt256(uint value) : this(Bits.GetBytes(value)) { }
public UInt256(ulong value) : this(Bits.GetBytes(value)) { }