/// <summary> /// Reverse endian of internal representation /// </summary> /// <returns></returns> public Hex Reverse() { _bytes = Hex.ReverseEndian(_bytes); return(this); }
/// <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); }
/// <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); }
/// <summary> /// Output as 4-byte integer /// </summary> /// <returns></returns> public int ToInt32() { return(Hex.Bytes2Int32(_bytes)); }
/// <summary> /// Output as 8-byte integer /// </summary> /// <returns></returns> public long ToInt64() { return(Hex.Bytes2Int64(_bytes)); }
/// <summary> /// Output as 2-byte integer /// </summary> /// <returns></returns> public short ToInt16() { return(Hex.Bytes2Int16(_bytes)); }
/// <summary> /// Output as UTF-8 text encoding /// </summary> /// <returns></returns> public string ToUTF8() { return(Hex.Bytes2UTF8(_bytes)); }
/// <summary> /// Output as Base64 binary encoding /// </summary> /// <returns></returns> public string ToBase64() { return(Hex.Hex2Base64(ToString())); }
/// <summary> /// Output as hexadecimal binary encoding /// </summary> /// <returns></returns> public new string ToString() { return(Hex.Bytes2Hex(_bytes)); }
/// <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); }