From 2cc74ee44e014a1f447c3d96a4c0d65e9f7cea2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Charv=C3=A1t?= Date: Wed, 20 Dec 2023 12:27:15 +0100 Subject: [PATCH] add comments --- .../storage/compression/ZstdDecompressOutputStream.scala | 2 +- .../storage/compression/ZstdDecompressOutputStreamTest.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/com/avast/clients/storage/compression/ZstdDecompressOutputStream.scala b/core/src/main/scala/com/avast/clients/storage/compression/ZstdDecompressOutputStream.scala index 7205ebf..ef417ea 100644 --- a/core/src/main/scala/com/avast/clients/storage/compression/ZstdDecompressOutputStream.scala +++ b/core/src/main/scala/com/avast/clients/storage/compression/ZstdDecompressOutputStream.scala @@ -18,7 +18,7 @@ class ZstdDecompressOutputStream(outputStream: OutputStream) extends OutputStrea throw new IllegalStateException("Stream is closed") } - val inputBuffer = ByteBuffer.allocateDirect(chunk.length) + val inputBuffer = ByteBuffer.allocateDirect(chunk.length) // ByteBuffer.wrap(chunk) does not work, we need direct buffer inputBuffer.put(chunk) inputBuffer.rewind() diff --git a/core/src/test/scala/com/avast/clients/storage/compression/ZstdDecompressOutputStreamTest.scala b/core/src/test/scala/com/avast/clients/storage/compression/ZstdDecompressOutputStreamTest.scala index 15e0c1e..ac8ea63 100644 --- a/core/src/test/scala/com/avast/clients/storage/compression/ZstdDecompressOutputStreamTest.scala +++ b/core/src/test/scala/com/avast/clients/storage/compression/ZstdDecompressOutputStreamTest.scala @@ -17,7 +17,7 @@ class ZstdDecompressOutputStreamTest extends FunSuite { } private def generateData(size: Int): Array[Byte] = { - 1.to(size).map(i => (i % 256).toByte).toArray + 1.to(size).map(i => (i % 256).toByte).toArray // generates compressible data, random data wouldn't compress well } test("decompress zstd stream") {