コード例 #1
0
 /// <summary>
 /// Reverse endian of internal representation
 /// </summary>
 /// <returns></returns>
 public Hex Reverse()
 {
     _bytes = Hex.ReverseEndian(_bytes);
     return(this);
 }
コード例 #2
0
 /// <summary>
 /// Output a subarray copy from an index to a given length
 /// </summary>
 /// <returns></returns>
 public Hex SubBytes(int startIndex, int length)
 {
     _bytes = Hex.SubBytes(_bytes, startIndex, length);
     return(this);
 }
コード例 #3
0
 /// <summary>
 /// Output a subarray copy from an index to end of array
 /// </summary>
 /// <param name="startIndex"></param>
 /// <returns></returns>
 public Hex SubBytes(int startIndex)
 {
     _bytes = Hex.SubBytes(_bytes, startIndex, _bytes.Length - startIndex);
     return(this);
 }
コード例 #4
0
 /// <summary>
 /// Output as 4-byte integer
 /// </summary>
 /// <returns></returns>
 public int ToInt32()
 {
     return(Hex.Bytes2Int32(_bytes));
 }
コード例 #5
0
 /// <summary>
 /// Output as 8-byte integer
 /// </summary>
 /// <returns></returns>
 public long ToInt64()
 {
     return(Hex.Bytes2Int64(_bytes));
 }
コード例 #6
0
 /// <summary>
 /// Output as 2-byte integer
 /// </summary>
 /// <returns></returns>
 public short ToInt16()
 {
     return(Hex.Bytes2Int16(_bytes));
 }
コード例 #7
0
 /// <summary>
 /// Output as UTF-8 text encoding
 /// </summary>
 /// <returns></returns>
 public string ToUTF8()
 {
     return(Hex.Bytes2UTF8(_bytes));
 }
コード例 #8
0
 /// <summary>
 /// Output as Base64 binary encoding
 /// </summary>
 /// <returns></returns>
 public string ToBase64()
 {
     return(Hex.Hex2Base64(ToString()));
 }
コード例 #9
0
 /// <summary>
 /// Output as hexadecimal binary encoding
 /// </summary>
 /// <returns></returns>
 public new string ToString()
 {
     return(Hex.Bytes2Hex(_bytes));
 }
コード例 #10
0
        /// <summary>
        /// Factory method for builder class
        /// </summary>
        /// <param name="bytes"></param>
        /// <returns></returns>
        public static Hex Parse(byte[] bytes)
        {
            Hex hex = new Hex(bytes);

            return(hex);
        }