/// <summary> /// Returns a new span for the given byte array segment. /// </summary> public static BufferSpan From(Byte[] buffer, Int32 offset, Int32 count) { Verify.ArraySegment(buffer, offset, count); return(new BufferSpan(buffer, offset, count)); }
/// <summary> /// Returns the upper-case hexadecimal representation of the given byte array. /// </summary> /// /// <param name="buffer"> /// The byte array to format. /// </param> /// <param name="offset"> /// The byte offset in buffer where the data begin. /// </param> /// <param name="count"> /// The number of bytes. /// </param> /// <param name="delimiter"> /// The delimiter to be used. /// </param> /// /// <returns> /// A string representation of the given byte array. /// </returns> /// /// <exception cref="ArgumentNullException"> /// Null values are invalid. /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// Negative values are invalid. /// </exception> /// <exception cref="ArgumentExceedsUpperLimitException"> /// Values exceeding the inclusive upper limit are invalid. /// </exception> public static String ToUpperHex(this Byte[] buffer, Int32 offset, Int32 count, String delimiter) { Verify.ArraySegment(buffer, offset, count); return(HexFormatter.ToUpper(buffer, offset, count, delimiter)); }