Skip to content

Commit

Permalink
Merge pull request #2341 from DataDog/mconstantin/fix-decompression-i…
Browse files Browse the repository at this point in the history
…n-sr-end-to-end-tests

Fix the decompression in SR instrumented tests for API 21
  • Loading branch information
mariusc83 authored Oct 24, 2024
2 parents ccbfe18 + 3f7b09e commit d13c96a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ internal abstract class BaseSessionReplayTest<R : Activity> {
val buf = ByteArray(1024)
val decompressor = Inflater()
decompressor.setInput(input, 0, input.size)
while (!decompressor.finished()) {
val resultLength = decompressor.inflate(buf)
bos.write(buf, 0, resultLength)
var uncompressedBytes = Int.MAX_VALUE
while (uncompressedBytes > 0) {
uncompressedBytes = decompressor.inflate(buf)
bos.write(buf, 0, uncompressedBytes)
}
decompressor.end()
return bos.toByteArray()
Expand Down

0 comments on commit d13c96a

Please sign in to comment.