Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9b1b145
cross-platforming compression
yurique Dec 25, 2021
5c2c8e3
FinalBytesPipe (?)
yurique Dec 25, 2021
c60c8b6
most tests are passing
yurique Dec 25, 2021
4f1a564
CRC32
yurique Dec 25, 2021
f8bfc16
all tests are passing
yurique Dec 26, 2021
3258066
.takeRight
yurique Dec 26, 2021
8d8e15d
revert fileCommentBytesSoftLimit to the larger value
yurique Dec 26, 2021
bb02efd
revert unneded changes
yurique Dec 26, 2021
8e1d285
keep trailer chunk not the whole stream after compressed bytes
yurique Dec 26, 2021
01c8005
some comments
yurique Dec 26, 2021
4c6f3bb
comments
yurique Dec 26, 2021
fd7057e
revert ioplatform
yurique Dec 26, 2021
181e4a7
use SuspendedStream instead
yurique Dec 26, 2021
5b5a11b
-empty line
yurique Dec 26, 2021
5eb7309
scalac warnings
yurique Dec 26, 2021
fb3f701
formatting
yurique Dec 26, 2021
87a529e
less diff
yurique Dec 26, 2021
f661471
less nesting
yurique Dec 26, 2021
f9a308a
less deferred
yurique Dec 26, 2021
88cd215
Merge branch 'main' into feature/js-compression-platform
yurique Dec 30, 2021
0917bcc
update args for zlib in test
yurique Dec 30, 2021
04de5aa
minor refactoring
yurique Dec 30, 2021
57d8023
move pipes into separate files
yurique Dec 30, 2021
75e672c
Sync gzip and crc from scodec
yurique Jan 1, 2022
f5de433
shared gzip for js/jvm
yurique Jan 1, 2022
28daec4
put the tests into the existing NodeJSCompressionSuite
yurique Jan 1, 2022
dd41468
inflate perf
yurique Jan 2, 2022
a7843d0
gzip perf
yurique Jan 2, 2022
7712826
shared compression tests
yurique Jan 2, 2022
f128d3c
PR feedback
yurique Jan 2, 2022
63efba3
UnconsUntil private
yurique Jan 2, 2022
1798ebd
make `UnconsUntil` `private[compression]` again (for scala3)
yurique Jan 2, 2022
47d4de8
no chaining in scala 2.12
yurique Jan 2, 2022
9adb40b
un-final GunzipResult
yurique Jan 2, 2022
14359c5
update the mima filter
yurique Jan 2, 2022
9440e5d
pull bracket
yurique Jan 4, 2022
1ff7f0b
Merge branch 'main' into feature/js-compression-platform
yurique Jan 8, 2022
7b52177
optional inflate crc calculation
yurique Jan 9, 2022
c1e222b
Merge branch 'main' into feature/js-compression-platform
yurique Jan 17, 2022
f50a35b
post merge tweaks
yurique Jan 17, 2022
022229e
Merge branch 'main' into feature/js-compression-platform
yurique Jan 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ ThisBuild / mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[DirectMissingMethodProblem](
"fs2.compression.Compression.gunzip$default$1$"
),
ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.ChunkCompanionPlatform.makeArrayBuilder")
ProblemFilters.exclude[DirectMissingMethodProblem]("fs2.ChunkCompanionPlatform.makeArrayBuilder"),
ProblemFilters.exclude[ReversedMissingMethodProblem](
"fs2.compression.Compression.gzip"
) // Compression is a sealed trait with an implementation
)

lazy val root = tlCrossRootProject
Expand Down
26 changes: 26 additions & 0 deletions core/js/src/main/scala/fs2/compression/ZipException.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2013 Functional Streams for Scala
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package fs2.compression

import java.io.IOException

class ZipException(message: String, cause: Throwable = null) extends IOException(message, cause)
396 changes: 396 additions & 0 deletions core/js/src/main/scala/fs2/compression/internal/CRC32.scala

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions core/js/src/main/scala/fs2/compression/internal/CrcBuilder.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2013 Functional Streams for Scala
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package fs2.compression.internal

import fs2.Chunk

private[fs2] class CrcBuilder {

private val crc = new CRC32

def update(b: Int): Unit =
crc.update(b)

def update(b: Array[Byte], off: Int, len: Int): Unit =
crc.update(b, off, len)

def update(c: Chunk[Byte]): Unit = {
val arr = c.toArraySlice
update(arr.values, arr.offset, arr.length)
}

def update(b: Array[Byte]): Unit =
crc.update(b)

def getValue: Long = crc.getValue()

}
Loading