Skip to content

Commit

Permalink
Fix access to Bzip2BlockSize
Browse files Browse the repository at this point in the history
Also: document zstd min level
  • Loading branch information
erikvanoosten committed Oct 21, 2024
1 parent b67b904 commit a7193f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bzip2/src/main/scala/zio/compress/Bzip2BlockSize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package zio.compress
* @param hundredKbIncrements
* a bzip2 block size in 100KB increments, valid values: 1 to 9
*/
final case class Bzip2BlockSize(hundredKbIncrements: Int)
final case class Bzip2BlockSize private (hundredKbIncrements: Int)

object Bzip2BlockSize {

Expand Down
6 changes: 6 additions & 0 deletions zstd/src/main/scala/zio/compress/ZstdCompressionLevel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ object ZstdCompressionLevel {
val VeryHighCompressionLevel: ZstdCompressionLevel = CompressionLevel19
val UltraCompressionLevel: ZstdCompressionLevel = CompressionLevelUltra22
}

// The minimum level of -131072 was calculated as `-(1L << 17)`
// and was derived from the C implementation of Zstd. See:
// https://github.com/facebook/zstd/blob/b880f20d52a925ebee373b5050c206ba325d935d/lib/compress/zstd_compress.c#L6988,
// https://github.com/facebook/zstd/blob/b880f20d52a925ebee373b5050c206ba325d935d/lib/zstd.h#L1249 and
// https://github.com/facebook/zstd/blob/b880f20d52a925ebee373b5050c206ba325d935d/lib/zstd.h#L142-L143.

0 comments on commit a7193f9

Please sign in to comment.