Showing the changes to Source/Libraries/GSF.Core/ByteEncoding.cs (1 of 72 files). Show all
Unified · Split
| @@ -121,10 +121,10 @@ namespace GSF · 120 unmodified lines | ||
| 121 | 121 | return bytes; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | − throw new ArgumentException("Input string is not a valid hex encoded string - invalid characters encountered", "hexData"); | |
| 124 | + throw new ArgumentException("Input string is not a valid hex encoded string - invalid characters encountered", nameof(hexData)); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | − throw new ArgumentNullException("hexData", "Input string cannot be null or empty"); | |
| 127 | + throw new ArgumentNullException(nameof(hexData), "Input string cannot be null or empty"); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /// <summary>Encodes given buffer into a user presentable representation.</summary> |
| @@ -187,10 +187,10 @@ namespace GSF · 56 unmodified lines | ||
| 187 | 187 | return bytes; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | − throw new ArgumentException("Input string is not a valid decimal encoded string - invalid characters encountered", "decData"); | |
| 190 | + throw new ArgumentException("Input string is not a valid decimal encoded string - invalid characters encountered", nameof(decData)); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | − throw new ArgumentNullException("decData", "Input string cannot be null or empty"); | |
| 193 | + throw new ArgumentNullException(nameof(decData), "Input string cannot be null or empty"); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /// <summary>Encodes given buffer into a user presentable representation.</summary> |
| @@ -322,10 +322,10 @@ namespace GSF · 125 unmodified lines | ||
| 322 | 322 | return bytes; |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | − throw new ArgumentException("Input string is not a valid binary encoded string - invalid characters encountered", "binaryData"); | |
| 325 | + throw new ArgumentException("Input string is not a valid binary encoded string - invalid characters encountered", nameof(binaryData)); | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | − throw new ArgumentNullException("binaryData", "Input string cannot be null or empty"); | |
| 328 | + throw new ArgumentNullException(nameof(binaryData), "Input string cannot be null or empty"); | |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /// <summary>Encodes given buffer into a user presentable representation.</summary> |
| @@ -337,7 +337,7 @@ namespace GSF · 5 unmodified lines | ||
| 337 | 337 | public override string GetString(byte[] bytes, int offset, int length, char spacingCharacter) |
| 338 | 338 | { |
| 339 | 339 | if ((object)bytes == null) |
| 340 | − throw new ArgumentNullException("bytes", "Input buffer cannot be null"); | |
| 340 | + throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null"); | |
| 341 | 341 | |
| 342 | 342 | // Initializes byte image array on first call for speed in future calls. |
| 343 | 343 | if ((object)m_byteImages == null) |
| @@ -475,7 +475,7 @@ namespace GSF · 131 unmodified lines | ||
| 475 | 475 | public override string GetString(byte[] bytes, int offset, int length, char spacingCharacter) |
| 476 | 476 | { |
| 477 | 477 | if ((object)bytes == null) |
| 478 | − throw new ArgumentNullException("bytes", "Input buffer cannot be null"); | |
| 478 | + throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null"); | |
| 479 | 479 | |
| 480 | 480 | string base64String = Convert.ToBase64String(bytes, offset, length); |
| 481 | 481 | |
| @@ -532,7 +532,7 @@ namespace GSF · 50 unmodified lines | ||
| 532 | 532 | public override string GetString(byte[] bytes, int offset, int length, char spacingCharacter) |
| 533 | 533 | { |
| 534 | 534 | if ((object)bytes == null) |
| 535 | − throw new ArgumentNullException("bytes", "Input buffer cannot be null"); | |
| 535 | + throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null"); | |
| 536 | 536 | |
| 537 | 537 | string asciiString = Encoding.ASCII.GetString(bytes, offset, length); |
| 538 | 538 | |
| @@ -578,7 +578,7 @@ namespace GSF · 39 unmodified lines | ||
| 578 | 578 | public virtual string GetString(byte[] bytes, char spacingCharacter) |
| 579 | 579 | { |
| 580 | 580 | if ((object)bytes == null) |
| 581 | − throw new ArgumentNullException("bytes", "Input buffer cannot be null"); | |
| 581 | + throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null"); | |
| 582 | 582 | |
| 583 | 583 | return GetString(bytes, 0, bytes.Length, spacingCharacter); |
| 584 | 584 | } |
| @@ -591,7 +591,7 @@ namespace GSF · 6 unmodified lines | ||
| 591 | 591 | public virtual string GetString(byte[] bytes, int offset, int length) |
| 592 | 592 | { |
| 593 | 593 | if ((object)bytes == null) |
| 594 | − throw new ArgumentNullException("bytes", "Input buffer cannot be null"); | |
| 594 | + throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null"); | |
| 595 | 595 | |
| 596 | 596 | return GetString(bytes, offset, length, NoSpacing); |
| 597 | 597 | } |
| @@ -610,7 +610,7 @@ namespace GSF · 12 unmodified lines | ||
| 610 | 610 | public virtual byte[] GetBytes(string value) |
| 611 | 611 | { |
| 612 | 612 | if (string.IsNullOrEmpty(value)) |
| 613 | − throw new ArgumentNullException("value", "Input string cannot be null"); | |
| 613 | + throw new ArgumentNullException(nameof(value), "Input string cannot be null"); | |
| 614 | 614 | return GetBytes(value, NoSpacing); |
| 615 | 615 | } |
| 616 | 616 | |
| @@ -726,7 +726,7 @@ namespace GSF · 109 unmodified lines | ||
| 726 | 726 | internal static string BytesToString(byte[] bytes, int offset, int length, char spacingCharacter, string format) |
| 727 | 727 | { |
| 728 | 728 | if ((object)bytes == null) |
| 729 | − throw new ArgumentNullException("bytes", "Input buffer cannot be null"); | |
| 729 | + throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null"); | |
| 730 | 730 | |
| 731 | 731 | StringBuilder byteString = new StringBuilder(); |
| 732 | 732 | |