Skip to content

Commit

Permalink
fix(backend): fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed Jan 8, 2024
1 parent b5217d8 commit 981b908
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,11 @@ class CompressionService(private val backendConfig: BackendConfig) {

private fun decompress(compressedSequenceString: String, dictionary: ByteArray?): String {
val compressed = Base64.getDecoder().decode(compressedSequenceString)
val decompressedSize = Zstd.decompressedSize(compressed).toInt()
val decompressedBuffer = ByteArray(decompressedSize)
val decompressedSize = Zstd.getFrameContentSize(compressed)
if (Zstd.isError(decompressedSize)) {
throw RuntimeException("reading Zstd decompressed size failed: error code $decompressedSize")
}
val decompressedBuffer = ByteArray(decompressedSize.toInt())
val decompressionReturnCode: Long = if (dictionary == null) {
Zstd.decompress(decompressedBuffer, compressed)
} else {
Expand Down

0 comments on commit 981b908

Please sign in to comment.