Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-char committed Dec 20, 2023
1 parent f736bcc commit 2cc74ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit 2cc74ee

Please sign in to comment.