/// <summary> /// Creates a new ByteArrayConverter using the given <see cref="ByteArrayConverterOptions"/>. /// </summary> /// <param name="options">The options.</param> public ByteArrayConverter(ByteArrayConverterOptions options = ByteArrayConverterOptions.Hexadecimal | ByteArrayConverterOptions.HexInclude0x) { // Defaults to the literal format used by C# for whole numbers, and SQL Server for binary data. this.options = options; ValidateOptions(); HexStringPrefix = options.HasFlag(ByteArrayConverterOptions.HexDashes) ? "-" : string.Empty; ByteLength = options.HasFlag(ByteArrayConverterOptions.HexDashes) ? (byte)3 : (byte)2; }