@@ -28,7 +28,7 @@ private ZStandardDictionary(SafeZStdCDictHandle? compressionDict, SafeZStdDDictH
2828 public static ZStandardDictionary Create ( ReadOnlyMemory < byte > buffer )
2929 {
3030 if ( buffer . IsEmpty )
31- throw new ArgumentException ( "Buffer cannot be empty." , nameof ( buffer ) ) ;
31+ throw new ArgumentException ( SR . ZStandardDictionary_EmptyBuffer , nameof ( buffer ) ) ;
3232
3333 byte [ ] dictionaryData = buffer . ToArray ( ) ;
3434
@@ -41,7 +41,7 @@ public static ZStandardDictionary Create(ReadOnlyMemory<byte> buffer)
4141 // Create only decompression dictionary since no quality level is specified
4242 SafeZStdDDictHandle decompressionDict = Interop . Zstd . ZSTD_createDDict ( dictData , ( nuint ) dictionaryData . Length ) ;
4343 if ( decompressionDict . IsInvalid )
44- throw new InvalidOperationException ( "Failed to create ZStandard decompression dictionary." ) ;
44+ throw new InvalidOperationException ( SR . ZStandardDictionary_CreateDecompressionFailed ) ;
4545
4646 return new ZStandardDictionary ( null , decompressionDict , dictionaryData ) ;
4747 }
@@ -56,7 +56,7 @@ public static ZStandardDictionary Create(ReadOnlyMemory<byte> buffer)
5656 public static ZStandardDictionary Create ( ReadOnlyMemory < byte > buffer , int quality )
5757 {
5858 if ( buffer . IsEmpty )
59- throw new ArgumentException ( "Buffer cannot be empty." , nameof ( buffer ) ) ;
59+ throw new ArgumentException ( SR . ZStandardDictionary_EmptyBuffer , nameof ( buffer ) ) ;
6060
6161 byte [ ] dictionaryData = buffer . ToArray ( ) ;
6262
@@ -69,14 +69,14 @@ public static ZStandardDictionary Create(ReadOnlyMemory<byte> buffer, int qualit
6969 // Create both compression and decompression dictionaries
7070 SafeZStdCDictHandle compressionDict = Interop . Zstd . ZSTD_createCDict ( dictData , ( nuint ) dictionaryData . Length , quality ) ;
7171 if ( compressionDict . IsInvalid )
72- throw new InvalidOperationException ( "Failed to create ZStandard compression dictionary." ) ;
72+ throw new InvalidOperationException ( SR . ZStandardDictionary_CreateCompressionFailed ) ;
7373 compressionDict . Quality = quality ;
7474
7575 SafeZStdDDictHandle decompressionDict = Interop . Zstd . ZSTD_createDDict ( dictData , ( nuint ) dictionaryData . Length ) ;
7676 if ( decompressionDict . IsInvalid )
7777 {
7878 compressionDict . Dispose ( ) ;
79- throw new InvalidOperationException ( "Failed to create ZStandard decompression dictionary." ) ;
79+ throw new InvalidOperationException ( SR . ZStandardDictionary_CreateDecompressionFailed ) ;
8080 }
8181
8282 return new ZStandardDictionary ( compressionDict , decompressionDict , dictionaryData ) ;
0 commit comments