Compression

fs2.compression.Compression$
See theCompression companion trait
object Compression

Attributes

Companion
trait
Source
Compression.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply[F[_]](implicit F: Compression[F]): Compression[F]

Attributes

Source
Compression.scala

Inherited methods

def forSync[F[_]](implicit F: Sync[F]): Compression[F]

Attributes

Inherited from:
`deflateParams₅`match{ caseparams:DeflateParamsifparams.header.==(ZLibParams.Header.GZIP)=> Stream.bracket[F,Tuple2[Deflater,CRC32]](F.delay[Tuple2[Deflater,CRC32]]({ val`deflater₇`:Deflater=newDeflater(params.level.juzDeflaterLevel,true) `deflater₇`.setStrategy(params.strategy.juzDeflaterStrategy) Tuple2.apply[Deflater,CRC32](`deflater₇`,newCRC32()) }))(((`x$1₄`:Tuple2[Deflater,CRC32])=>`x$1₄`match{ caseTuple2(deflater,_)=> F.delay[Unit](`deflater₈`.end()) })).flatMap[[x>:Nothing<:Any]=>F[x],Byte](((`x$1₅`:Tuple2[Deflater,CRC32])=>`x$1₅`match{ caseTuple2(deflater,crc32)=> $anon.this._gzip_header(fileName,modificationTime,comment,params.level.juzDeflaterLevel,params.fhCrcEnabled).++[[x>:Nothing<:Any]=>F[x],Byte]($anon.this._deflate(params,`deflater₉`,Some.apply[CRC32](`crc32₇`)).apply(`stream₃`)).++[[x>:Nothing<:Any]=>F[x],Byte]($anon.this._gzip_trailer(`deflater₉`,`crc32₇`)) }))(value) caseparams:DeflateParams=> Stream.raiseError[F](newZipException(_root_.scala.StringContext.apply("","headertyperequired,not",".").s(ZLibParams.Header.GZIP,`params₂`.header)))(fromApplicativeError[F](F)) }) def_gzip_header(`fileName₂`:Option[String],`modificationTime₂`:Option[Instant],`comment₂`:Option[String],deflateLevel:Int,fhCrcEnabled:Boolean):Stream[F,Byte]={ valsecondsSince197001010000:Long=`modificationTime₂`.map[Long](((_$10:Instant)=>_$10.getEpochSecond())).getOrElse[Long](0L) valheader:Array[Byte]=Array.apply[Byte]($anon.this.gzipMagicFirstByte,$anon.this.gzipMagicSecondByte,$anon.this.gzipCompressionMethod.DEFLATE,(if(fhCrcEnabled)$anon.this.gzipFlag.FHCRCelse$anon.this.zeroByte).+(`fileName₂`.map[Byte](((_$11:String)=>$anon.this.gzipFlag.FNAME)).getOrElse[Byte]($anon.this.zeroByte)).+(`comment₂`.map[Byte](((_$12:String)=>$anon.this.gzipFlag.FCOMMENT)).getOrElse[Byte]($anon.this.zeroByte)).toByte,secondsSince197001010000.&(255).toByte,secondsSince197001010000.>>(8).&(255).toByte,secondsSince197001010000.>>(16).&(255).toByte,secondsSince197001010000.>>(24).&(255).toByte,deflateLevelmatch{ caseDeflater.BEST_COMPRESSION=> $anon.this.gzipExtraFlag.DEFLATE_MAX_COMPRESSION_SLOWEST_ALGO caseDeflater.BEST_SPEED=> $anon.this.gzipExtraFlag.DEFLATE_FASTEST_ALGO case_=> $anon.this.zeroByte },$anon.this.gzipOperatingSystem.THIS)(ClassTag.apply[Byte](classOf[Byte])) val`crc32₈`:CRC32=newCRC32() `crc32₈`.update(header) valfileNameEncoded:Option[Array[Byte]]=`fileName₂`.map[Array[Byte]](((string:String)=>{ valbytes:Array[Byte]=string.replaceAll("\u0000","_").getBytes(StandardCharsets.ISO_8859_1) `crc32₈`.update(bytes) `crc32₈`.update($anon.this.zeroByte.toInt) (bytes:Array[Byte]) })) valcommentEncoded:Option[Array[Byte]]=`comment₂`.map[Array[Byte]](((`string₂`:String)=>{ val`bytes₂`:Array[Byte]=`string₂`.replaceAll("\u0000","").getBytes(StandardCharsets.ISO_8859_1) `crc32₈`.update(`bytes₂`) `crc32₈`.update($anon.this.zeroByte.toInt) (`bytes₂`:Array[Byte]) })) valcrc32Value:Long=`crc32₈`.getValue() valcrc16:Array[Byte]=if(fhCrcEnabled)Array.apply[Byte](crc32Value.&(255).toByte,crc32Value.>>(8).&(255).toByte)(ClassTag.apply[Byte](classOf[Byte]))elseArray.emptyByteArray Stream.chunk[[x>:Nothing<:Any]=>Pure[x],Byte]($anon.this.moveAsChunkBytes(header)).++[[x>:Nothing<:Any]=>Pure[x],Byte](fileNameEncoded.map[Stream[[x>:Nothing<:Any]=>Pure[x],Byte]](((`bytes₃`:Array[Byte])=>Stream.chunk[[x>:Nothing<:Any]=>Pure[x],Byte]($anon.this.moveAsChunkBytes(`bytes₃`)).++[[x>:Nothing<:Any]=>Pure[x],Byte](Stream.emit[[x>:Nothing<:Any]=>Pure[x],Byte]($anon.this.zeroByte)))).getOrElse[Stream[[x>:Nothing<:Any]=>Pure[x],Byte]](Stream.empty)).++[[x>:Nothing<:Any]=>Pure[x],Byte](commentEncoded.map[Stream[[x>:Nothing<:Any]=>Pure[x],Byte]](((`bytes₄`:Array[Byte])=>Stream.chunk[[x>:Nothing<:Any]=>Pure[x],Byte]($anon.this.moveAsChunkBytes(`bytes₄`)).++[[x>:Nothing<:Any]=>Pure[x],Byte](Stream.emit[[x>:Nothing<:Any]=>Pure[x],Byte]($anon.this.zeroByte)))).getOrElse[Stream[[x>:Nothing<:Any]=>Pure[x],Byte]](Stream.empty)).++[[x>:Nothing<:Any]=>Pure[x],Byte](Stream.chunk[[x>:Nothing<:Any]=>Pure[x],Byte]($anon.this.moveAsChunkBytes(crc16))) } def_gzip_trailer(`deflater₁₀`:Deflater,`crc32₉`:CRC32):Stream[F,Byte]={ val`crc32Value₂`:Long=`crc32₉`.getValue() valbytesIn:Int=`deflater₁₀`.getTotalIn() valtrailer:Array[Byte]=Array.apply[Byte](`crc32Value₂`.&(255).toByte,`crc32Value₂`.>>(8).&(255).toByte,`crc32Value₂`.>>(16).&(255).toByte,`crc32Value₂`.>>(24).&(255).toByte,bytesIn.&(255).toByte,bytesIn.>>(8).&(255).toByte,bytesIn.>>(16).&(255).toByte,bytesIn.>>(24).&(255).toByte)(ClassTag.apply[Byte](classOf[Byte])) Stream.chunk[[x>:Nothing<:Any]=>Pure[x],Byte]($anon.this.moveAsChunkBytes(trailer)) } defgunzip(`inflateParams₄`:InflateParams):Function1[Stream[F,Byte],Stream[F,GunzipResult[F]]]=((`stream₄`:Stream[F,Byte])=>`inflateParams₄`match{ caseparams:InflateParamsif`params₃`.header.==(ZLibParams.Header.GZIP)=> StreamPullOps[F,GunzipResult[F]](Pull.bracketCase[F,GunzipResult[F],Tuple3[Inflater,CRC32,CRC32],Unit](Pull.eval[F,Tuple3[Inflater,CRC32,CRC32]](F.delay[Tuple3[Inflater,CRC32,CRC32]](Tuple3.apply[Inflater,CRC32,CRC32](newInflater(true),newCRC32(),newCRC32()))),((`x$1₆`:Tuple3[Inflater,CRC32,CRC32])=>`x$1₆`match{ caseTuple3(inflater,headerCrc32,contentCrc32)=> { val$1$:ToPull[F,Byte]=InvariantOps[F,Byte](`stream₄`).pull $1$.unconsN($anon.this.gzipHeaderBytes,$1$.unconsN$default$2) }.flatMap[[x>:Nothing<:Any]=>F[x],GunzipResult[F],Unit](((`x$1₇`:Option[Tuple2[Chunk[Byte],Stream[F,Byte]]])=>`x$1₇`match{ caseSome(Tuple2(mandatoryHeaderChunk,streamAfterMandatoryHeader))=> $anon.this._gunzip_matchMandatoryHeader(`params₃`,mandatoryHeaderChunk,streamAfterMandatoryHeader,headerCrc32,contentCrc32,`inflater₆`) caseNone=> Pull.output1[Nothing,GunzipResult[F]](GunzipResult.apply[F](Stream.raiseError[F](newEOFException())(fromApplicativeError[F](F)),GunzipResult.$lessinit$greater$default$2[F],GunzipResult.$lessinit$greater$default$3[F],GunzipResult.$lessinit$greater$default$4[F])) })) }),((`x$1₈`:Tuple3[Inflater,CRC32,CRC32],x$2:ExitCase)=>Tuple2.apply[Tuple3[Inflater,CRC32,CRC32],ExitCase](`x$1₈`,x$2)match{ caseTuple2(Tuple3(inflater,_,_),_)=> Pull.eval[F,Unit](F.delay[Unit](`inflater₇`.end())) }))).stream caseparams:InflateParams=> Stream.raiseError[F](newZipException(_root_.scala.StringContext.apply("","headertyperequired,not",".").s(ZLibParams.Header.GZIP,`params₄`.header)))(fromApplicativeError[F](F)) }) def_gunzip_matchMandatoryHeader(`inflateParams₅`:InflateParams,`mandatoryHeaderChunk₂`:Chunk[Byte],`streamAfterMandatoryHeader₂`:Stream[F,Byte],`headerCrc32₂`:CRC32,`contentCrc32₂`:CRC32,`inflater₈`:Inflater):Pull[[x>:Nothing<:Any]=>F[x],GunzipResult[F],Unit]={ valmandatoryHeaderSlice:ArraySlice[Byte]=`mandatoryHeaderChunk₂`.toArraySlice[Byte](ClassTag.apply[Byte](classOf[Byte])) valmandatoryHeaderBytes:Array[Byte]=if(mandatoryHeaderSlice.offset.==(0))mandatoryHeaderSlice.valueselsemandatoryHeaderSlice.compact[Byte](ClassTag.apply[Byte](classOf[Byte])).values Tuple2.apply[Int,Array[Byte]](`mandatoryHeaderChunk₂`.size,mandatoryHeaderBytes)match{ caseTuple2($anon.this.gzipHeaderBytes,Array($anon.this.gzipMagicFirstByte,$anon.this.gzipMagicSecondByte,$anon.this.gzipCompressionMethod.DEFLATE,flags,_:_*))if$anon.this.gzipFlag.reserved5(flags)=> Pull.output1[Nothing,GunzipResult[F]](GunzipResult.apply[F](Stream.raiseError[F](newZipException("Unsupportedgzipflagreservedbit5isnon-zero"))(fromApplicativeError[F](F)),GunzipResult.$lessinit$greater$default$2[F],GunzipResult.$lessinit$greater$default$3[F],GunzipResult.$lessinit$greater$default$4[F])) caseTuple2($anon.this.gzipHeaderBytes,Array($anon.this.gzipMagicFirstByte,$anon.this.gzipMagicSecondByte,$anon.this.gzipCompressionMethod.DEFLATE,flags,_:_*))if$anon.this.gzipFlag.reserved6(`flags₂`)=> Pull.output1[Nothing,GunzipResult[F]](GunzipResult.apply[F](Stream.raiseError[F](newZipException("Unsupportedgzipflagreservedbit6isnon-zero"))(fromApplicativeError[F](F)),GunzipResult.$lessinit$greater$default$2[F],GunzipResult.$lessinit$greater$default$3[F],GunzipResult.$lessinit$greater$default$4[F])) caseTuple2($anon.this.gzipHeaderBytes,Array($anon.this.gzipMagicFirstByte,$anon.this.gzipMagicSecondByte,$anon.this.gzipCompressionMethod.DEFLATE,flags,_:_*))if$anon.this.gzipFlag.reserved7(`flags₃`)=> Pull.output1[Nothing,GunzipResult[F]](GunzipResult.apply[F](Stream.raiseError[F](newZipException("Unsupportedgzipflagreservedbit7isnon-zero"))(fromApplicativeError[F](F)),GunzipResult.$lessinit$greater$default$2[F],GunzipResult.$lessinit$greater$default$3[F],GunzipResult.$lessinit$greater$default$4[F])) caseTuple2($anon.this.gzipHeaderBytes,header@Array($anon.this.gzipMagicFirstByte,$anon.this.gzipMagicSecondByte,$anon.this.gzipCompressionMethod.DEFLATE,flags,_:_*))=> `headerCrc32₂`.update(`header₂`) val`secondsSince197001010000₂`:Long=$anon.this.unsignedToLong(`header₂`.apply(4),`header₂`.apply(5),`header₂`.apply(6),`header₂`.apply(7)) InvariantOps[F,GunzipResult[F]]($anon.this._gunzip_readOptionalHeader(`inflateParams₅`,`streamAfterMandatoryHeader₂`,`flags₄`,`headerCrc32₂`,`contentCrc32₂`,`secondsSince197001010000₂`,`inflater₈`)).pull.uncons1.flatMap[[x>:Nothing<:Any]=>F[x],GunzipResult[F],Unit](((`x$1₉`:Option[Tuple2[GunzipResult[F],Stream[F,GunzipResult[F]]]])=>`x$1₉`match{ caseSome(Tuple2(gunzipResult,_))=> Pull.output1[Nothing,GunzipResult[F]](gunzipResult) caseNone=> Pull.output1[Nothing,GunzipResult[F]](GunzipResult.apply[F](Stream.raiseError[F](newEOFException())(fromApplicativeError[F](F)),GunzipResult.$lessinit$greater$default$2[F],GunzipResult.$lessinit$greater$default$3[F],GunzipResult.$lessinit$greater$default$4[F])) })) caseTuple2($anon.this.gzipHeaderBytes,Array($anon.this.gzipMagicFirstByte,$anon.this.gzipMagicSecondByte,compressionMethod,_:_*))=> Pull.output1[Nothing,GunzipResult[F]](GunzipResult.apply[F](Stream.raiseError[F](newZipException(_root_.scala.StringContext.apply("Unsupportedgzipcompressionmethod:","").s(compressionMethod)))(fromApplicativeError[F](F)),GunzipResult.$lessinit$greater$default$2[F],GunzipResult.$lessinit$greater$default$3[F],GunzipResult.$lessinit$greater$default$4[F])) case_=> Pull.output1[Nothing,GunzipResult[F]](GunzipResult.apply[F](Stream.raiseError[F](newZipException("Notingzipformat"))(fromApplicativeError[F](F)),GunzipResult.$lessinit$greater$default$2[F],GunzipResult.$lessinit$greater$default$3[F],GunzipResult.$lessinit$greater$default$4[F])) } } def_gunzip_readOptionalHeader(`inflateParams₆`:InflateParams,`streamAfterMandatoryHeader₃`:Stream[F,Byte],`flags₅`:Byte,`headerCrc32₃`:CRC32,`contentCrc32₃`:CRC32,`secondsSince197001010000₃`:Long,`inflater₉`:Inflater):Stream[F,GunzipResult[F]]=`streamAfterMandatoryHeader₃`.through[[x>:Nothing<:Any]=>F[x],Byte]($anon.this._gunzip_skipOptionalExtraField($anon.this.gzipFlag.fextra(`flags₅`),`headerCrc32₃`)).through[[x>:Nothing<:Any]=>F[x],Tuple2[Option[String],Stream[F,Byte]]]($anon.this._gunzip_readOptionalStringField($anon.this.gzipFlag.fname(`flags₅`),`headerCrc32₃`,"filename",$anon.this.fileNameBytesSoftLimit)).flatMap[[x>:Nothing<:Any]=>F[x],GunzipResult[F]](((`x$1₁₀`:Tuple2[Option[String],Stream[F,Byte]])=>`x$1₁₀`match{ caseTuple2(fileName,streamAfterFileName)=> streamAfterFileName.through[[x>:Nothing<:Any]=>F[x],Tuple2[Option[String],Stream[F,Byte]]]($anon.this._gunzip_readOptionalStringField($anon.this.gzipFlag.fcomment(`flags₅`),`headerCrc32₃`,"filecomment",$anon.this.fileCommentBytesSoftLimit)).flatMap[[x>:Nothing<:Any]=>F[x],GunzipResult[F]](((`x$1₁₁`:Tuple2[Option[String],Stream[F,Byte]])=>`x$1₁₁`match{ caseTuple2(comment,streamAfterComment)=> Stream.emit[[x>:Nothing<:Any]=>Pure[x],GunzipResult[F]]({ valmodificationTime$1:Some[Instant]|None=if(`secondsSince197001010000₃`.!=(0))Some.apply[Instant](Instant.ofEpochSecond(`secondsSince197001010000₃`))elseNone valcontent$1:Stream[[x>:Nothing<:Any]=>F[x],Byte]=streamAfterComment.through[[x>:Nothing<:Any]=>F[x],Byte]($anon.this._gunzip_validateHeader(`flags₅`.&($anon.this.gzipFlag.FHCRC).==($anon.this.gzipFlag.FHCRC),`headerCrc32₃`)).through[[x>:Nothing<:Any]=>F[x],Byte](((s:Stream[[x>:Nothing<:Any]=>F[x],Byte])=>StreamPullOps[F,Byte]($anon.this._inflate(inflateParams=`inflateParams₆`,inflater=`inflater₉`,crc32=Some.apply[CRC32](`contentCrc32₃`)).apply(s)).stream)).through[[x>:Nothing<:Any]=>F[x],Byte]($anon.this._gunzip_validateTrailer(`contentCrc32₃`,`inflater₉`)) GunzipResult.apply[F](content=content$1,modificationTime=modificationTime$1,fileName=`fileName₃`,comment=`comment₃`) }) }))(value) }))(value) def_gunzip_skipOptionalExtraField(isPresent:Boolean,`crc32₁₀`:CRC32):Pipe[F,Byte,Byte]=((`stream₅`:Stream[F,Byte])=>if(isPresent)StreamPullOps[[x>:Nothing<:Any]=>F[x],Stream[F,Byte]]({ val$2$:ToPull[F,Byte]=InvariantOps[F,Byte](`stream₅`).pull $2$.unconsN($anon.this.gzipOptionalExtraFieldLengthBytes,$2$.unconsN$default$2) }.flatMap[[x>:Nothing<:Any]=>F[x],Stream[F,Byte],Unit](((`x$1₁₂`:Option[Tuple2[Chunk[Byte],Stream[F,Byte]]])=>`x$1₁₂`match{ caseSome(Tuple2(optionalExtraFieldLengthChunk,streamAfterOptionalExtraFieldLength))=> Tuple2.apply[Int,Array[Byte]](optionalExtraFieldLengthChunk.size,optionalExtraFieldLengthChunk.toArraySlice[Byte](ClassTag.apply[Byte](classOf[Byte])).values)match{ caseTuple2($anon.this.gzipOptionalExtraFieldLengthBytes,lengthBytes@Array(firstByte,secondByte))=> `crc32₁₀`.update(lengthBytes) valoptionalExtraFieldLength:Int=$anon.this.unsignedToInt(firstByte,secondByte) { val$3$:ToPull[F,Byte]=InvariantOps[F,Byte](streamAfterOptionalExtraFieldLength).pull $3$.unconsN(optionalExtraFieldLength,$3$.unconsN$default$2) }.flatMap[[x>:Nothing<:Any]=>F[x],Stream[F,Byte],Unit](((`x$1₁₃`:Option[Tuple2[Chunk[Byte],Stream[F,Byte]]])=>`x$1₁₃`match{ caseSome(Tuple2(optionalExtraFieldChunk,streamAfterOptionalExtraField))=> valfieldBytes:ArraySlice[Byte]=optionalExtraFieldChunk.toArraySlice[Byte](ClassTag.apply[Byte](classOf[Byte])) `crc32₁₀`.update(fieldBytes.values,fieldBytes.offset,fieldBytes.length) Pull.output1[Nothing,Stream[F,Byte]](streamAfterOptionalExtraField) caseNone=> Pull.raiseError[F](newZipException("Failedtoreadoptionalextrafieldheader"))(fromApplicativeError[F](F)) })) case_=> Pull.raiseError[F](newZipException("Failedtoreadoptionalextrafieldheaderlength"))(fromApplicativeError[F](F)) } caseNone=> Pull.raiseError[F](newEOFException())(fromApplicativeError[F](F)) }))).stream.flatten[[x>:Nothing<:Any]=>F[x],Byte](refl[Stream[F,Byte]])else`stream₅`) def_gunzip_readOptionalStringField(`isPresent₂`:Boolean,`crc32₁₁`:CRC32,fieldName:String,fieldBytesSoftLimit:Int):Function1[Stream[F,Byte],Stream[F,Tuple2[Option[String],Stream[F,Byte]]]]=((`stream₆`:Stream[F,Byte])=>if(`isPresent₂`)StreamPullOps[[x>:Nothing<:Any]=>F[x],Tuple2[Option[String],Stream[F,Byte]]]($anon.this.unconsUntil[Byte](((_$13:Byte)=>_$13.==($anon.this.zeroByte)),fieldBytesSoftLimit)(ClassTag.apply[Byte](classOf[Byte])).apply(`stream₆`).flatMap[[x>:Nothing<:Any]=>F[x],Tuple2[Option[String],Stream[F,Byte]],Unit](((`x$1₁₄`:Option[Tuple2[Chunk[Byte],Stream[F,Byte]]])=>`x$1₁₄`match{ caseSome(Tuple2(chunk,rest))=> Pull.output1[Nothing,Tuple2[Some[String],Stream[F,Byte]]](Tuple2.apply[Some[String],Stream[F,Byte]](if(`chunk₃`.isEmpty)Some.apply[String]("")else{ val`bytesChunk₃`:ArraySlice[Byte]=`chunk₃`.toArraySlice[Byte](ClassTag.apply[Byte](classOf[Byte])) `crc32₁₁`.update(`bytesChunk₃`.values,`bytesChunk₃`.offset,`bytesChunk₃`.length) Some.apply[String](newString(`bytesChunk₃`.values,`bytesChunk₃`.offset,`bytesChunk₃`.length,StandardCharsets.ISO_8859_1)) },rest.dropWhile(((byte:Byte)=>{ `crc32₁₁`.update(byte.toInt) byte.!=($anon.this.zeroByte) })).drop(1L))) caseNone=> Pull.output1[Nothing,Tuple2[Option[String],Stream[F,Nothing]]](Tuple2.apply[Option[String],Stream[F,Nothing]](Option.empty[String],Stream.raiseError[F](newZipException(_root_.scala.StringContext.apply("Failedtoread","field").s(fieldName)))(fromApplicativeError[F](F)))) }))).streamelseStream.emit[[x>:Nothing<:Any]=>Pure[x],Tuple2[Option[String],Stream[F,Byte]]](Tuple2.apply[Option[String],Stream[F,Byte]](Option.empty[String],`stream₆`)).$asInstanceOf$[Stream[[x>:Nothing<:Any]=>F[x],Tuple2[Option[String],Stream[F,Byte]]]]) def_gunzip_validateHeader(`isPresent₃`:Boolean,`crc32₁₂`:CRC32):Pipe[F,Byte,Byte]=((`stream₇`:Stream[F,Byte])=>if(`isPresent₃`)StreamPullOps[[x>:Nothing<:Any]=>F[x],Stream[F,Byte]]({ val$4$:ToPull[F,Byte]=InvariantOps[F,Byte](`stream₇`).pull $4$.unconsN($anon.this.gzipHeaderCrcBytes,$4$.unconsN$default$2) }.flatMap[[x>:Nothing<:Any]=>F[x],Stream[F,Byte],Unit](((`x$1₁₅`:Option[Tuple2[Chunk[Byte],Stream[F,Byte]]])=>`x$1₁₅`match{ caseSome(Tuple2(headerCrcChunk,streamAfterHeaderCrc))=> valexpectedHeaderCrc16:Int=$anon.this.unsignedToInt(headerCrcChunk.apply(0),headerCrcChunk.apply(1)) valactualHeaderCrc16:Long=`crc32₁₂`.getValue().&(65535) if(expectedHeaderCrc16.!=(actualHeaderCrc16))Pull.raiseError[F](newZipException("HeaderfailedCRCvalidation"))(fromApplicativeError[F](F))elsePull.output1[Nothing,Stream[F,Byte]](streamAfterHeaderCrc) caseNone=> Pull.raiseError[F](newZipException("FailedtoreadheaderCRC"))(fromApplicativeError[F](F)) }))).stream.flatten[[x>:Nothing<:Any]=>F[x],Byte](refl[Stream[F,Byte]])else`stream₇`) def_gunzip_validateTrailer(`crc32₁₃`:CRC32,`inflater₁₀`:Inflater):Pipe[F,Byte,Byte]=((`stream₈`:Stream[F,Byte])=>StreamPullOps[F,Byte]({ defvalidateTrailer(trailerChunk:Chunk[Byte]):Pull[F,Byte,Unit]=if(trailerChunk.size.==($anon.this.gzipTrailerBytes)){ valexpectedInputCrc32:Long=$anon.this.unsignedToLong(trailerChunk.apply(0),trailerChunk.apply(1),trailerChunk.apply(2),trailerChunk.apply(3)) valactualInputCrc32:Long=`crc32₁₃`.getValue() valexpectedInputSize:Long=$anon.this.unsignedToLong(trailerChunk.apply(4),trailerChunk.apply(5),trailerChunk.apply(6),trailerChunk.apply(7)) valactualInputSize:Long=`inflater₁₀`.getBytesWritten().&(4294967295L) if(expectedInputCrc32.!=(actualInputCrc32))Pull.raiseError[F](newZipException("ContentfailedCRCvalidation"))(fromApplicativeError[F](F))elseif(expectedInputSize.!=(actualInputSize))Pull.raiseError[F](newZipException("Contentfailedsizevalidation"))(fromApplicativeError[F](F))elsePull.done }elsePull.raiseError[F](newZipException("Failedtoreadtrailer(1)"))(fromApplicativeError[F](F)) defstreamUntilTrailer(last:Chunk[Byte]):Function1[Stream[F,Byte],Pull[F,Byte,Unit]]=((_$14:Stream[F,Byte])=>InvariantOps[F,Byte](_$14).pull.uncons.flatMap[F,Byte,Unit](((`x$1₁₆`:Option[Tuple2[Chunk[Byte],Stream[F,Byte]]])=>`x$1₁₆`match{ caseSome(Tuple2(next,rest))=> if(`inflater₁₀`.finished())if(next.size.>=($anon.this.gzipTrailerBytes))if(last.nonEmpty)Pull.output[Nothing,Byte](last).>>[F,Byte,Unit](streamUntilTrailer(next).apply(`rest₂`))elsestreamUntilTrailer(next).apply(`rest₂`)elsestreamUntilTrailer(last.++[Byte](next)).apply(`rest₂`)elseif(last.nonEmpty)Pull.output[Nothing,Byte](last).>>[[x>:Nothing<:Any]=>Nothing,Byte,Unit](Pull.output[Nothing,Byte](next)).>>[F,Byte,Unit](streamUntilTrailer(Chunk.empty[Byte]).apply(`rest₂`))elsePull.output[Nothing,Byte](next).>>[F,Byte,Unit](streamUntilTrailer(Chunk.empty[Byte]).apply(`rest₂`)) caseNone=> valpreTrailerBytes:Int=last.size.-($anon.this.gzipTrailerBytes) if(preTrailerBytes.>(0))Pull.output[Nothing,Byte](last.take(preTrailerBytes)).>>[F,Byte,Unit](validateTrailer(last.drop(preTrailerBytes)))elsevalidateTrailer(last) }))) streamUntilTrailer(Chunk.empty[Byte]).apply(`stream₈`) }).stream) defunconsUntil[O](predicate:Function1[O,Boolean],softLimit:Int)(implicitevidence$4:ClassTag[O]):Function1[Stream[F,O],Pull[F,Nothing,Option[Tuple2[Chunk[O],Stream[F,O]]]]]=((`stream₉`:Stream[F,O])=>{ defgo(acc:List[Chunk[O]],`rest₃`:Stream[F,O],size:Int):Pull[F,Nothing,Option[Tuple2[Chunk[O],Stream[F,O]]]]=InvariantOps[F,O](`rest₃`).pull.uncons.flatMap[[x>:Nothing<:Any]=>F[x],Nothing,Option[Tuple2[Chunk[O],Stream[F,O]]]](((`x$1₁₇`:Option[Tuple2[Chunk[O],Stream[F,O]]])=>`x$1₁₇`match{ caseNone=> Pull.pure[Nothing,None.type](None) caseSome(Tuple2(hd,tl))=> hd.indexWhere(predicate)match{ caseSome(i)=> val$5$:Tuple2[Chunk[O],Chunk[O]]=(hd.splitAt(i):Tuple2[Chunk[O],Chunk[O]]@unchecked)match{ caseTuple2(pfx,sfx)=> Tuple2.apply[Chunk[O],Chunk[O]](pfx,sfx) } val`pfx₂`:Chunk[O]=$5$._1 val`sfx₂`:Chunk[O]=$5$._2 Pull.pure[Nothing,Some[Tuple2[Chunk[O],Stream[F,O]]]](Some.apply[Tuple2[Chunk[O],Stream[F,O]]](ArrowAssoc[Chunk[O]](Chunk.concat[O](acc.::[Chunk[O]](`pfx₂`).reverse)(evidence$4)).->[Stream[F,O]](tl.cons[O](`sfx₂`)))) caseNone=> valnewSize:Int=size.+(hd.size) if(newSize.<(softLimit))go(acc.::[Chunk[O]](hd),tl,newSize)elsePull.pure[Nothing,Some[Tuple2[Chunk[O],Stream[F,O]]]](Some.apply[Tuple2[Chunk[O],Stream[F,O]]](ArrowAssoc[Chunk[O]](Chunk.concat[O](acc.::[Chunk[O]](hd).reverse)(evidence$4)).->[Stream[F,O]](tl))) } })) defgo$default$3:Int@uncheckedVariance=0 go(Nil,`stream₉`,go$default$3) }) valgzipHeaderBytes:Int=10 valgzipMagicFirstByte:Byte=31.toByte valgzipMagicSecondByte:Byte=139.toByte objectgzipCompressionMethod{ valDEFLATE:Byte=Deflater.DEFLATED.toByte } objectgzipFlag{ defapply(`flags₆`:Byte,flag:Byte):Boolean=`flags₆`.&(flag).==(flag) defapply(`flags₇`:Byte,`flag₂`:Int):Boolean=`flags₇`.&(`flag₂`).==(`flag₂`) defftext(`flags₈`:Byte):Boolean=gzipFlag.this.apply(`flags₈`,gzipFlag.this.FTEXT) deffhcrc(`flags₉`:Byte):Boolean=gzipFlag.this.apply(`flags₉`,gzipFlag.this.FHCRC) deffextra(`flags₁₀`:Byte):Boolean=gzipFlag.this.apply(`flags₁₀`,gzipFlag.this.FEXTRA) deffname(`flags₁₁`:Byte):Boolean=gzipFlag.this.apply(`flags₁₁`,gzipFlag.this.FNAME) deffcomment(`flags₁₂`:Byte):Boolean=gzipFlag.this.apply(`flags₁₂`,gzipFlag.this.FCOMMENT) defreserved5(`flags₁₃`:Byte):Boolean=gzipFlag.this.apply(`flags₁₃`,gzipFlag.this.RESERVED_BIT_5) defreserved6(`flags₁₄`:Byte):Boolean=gzipFlag.this.apply(`flags₁₄`,gzipFlag.this.RESERVED_BIT_6) defreserved7(`flags₁₅`:Byte):Boolean=gzipFlag.this.apply(`flags₁₅`,gzipFlag.this.RESERVED_BIT_7) valFTEXT:Byte=1 valFHCRC:Byte=2 valFEXTRA:Byte=4 valFNAME:Byte=8 valFCOMMENT:Byte=16 valRESERVED_BIT_5:Int=32 valRESERVED_BIT_6:Int=64 valRESERVED_BIT_7:Int=128 } objectgzipExtraFlag{ valDEFLATE_MAX_COMPRESSION_SLOWEST_ALGO:Byte=2 valDEFLATE_FASTEST_ALGO:Byte=4 } valgzipOptionalExtraFieldLengthBytes:Int=2 valgzipHeaderCrcBytes:Int=2 objectgzipOperatingSystem{ valFAT_FILESYSTEM:Byte=0 valAMIGA:Byte=1 valVMS:Byte=2 valUNIX:Byte=3 valVM_CMS:Byte=4 valATARI_TOS:Byte=5 valHPFS_FILESYSTEM:Byte=6 valMACINTOSH:Byte=7 valZ_SYSTEM:Byte=8 valCP_M:Byte=9 valTOPS_20:Byte=10 valNTFS_FILESYSTEM:Byte=11 valQDOS:Byte=12 valACORN_RISCOS:Byte=13 valUNKNOWN:Byte=255.toByte valTHIS:Byte=System.getProperty("os.name").toLowerCase()match{ casenameifname.indexOf("nux").>(0)=> gzipOperatingSystem.this.UNIX casenameif`name₂`.indexOf("nix").>(0)=> gzipOperatingSystem.this.UNIX casenameif`name₃`.indexOf("aix").>=(0)=> gzipOperatingSystem.this.UNIX casenameif`name₄`.indexOf("win").>=(0)=> gzipOperatingSystem.this.NTFS_FILESYSTEM casenameif`name₅`.indexOf("mac").>=(0)=> gzipOperatingSystem.this.MACINTOSH case_=> gzipOperatingSystem.this.UNKNOWN } } valgzipInputCrcBytes:Int=4 valgzipInputSizeBytes:Int=4 valgzipTrailerBytes:Int=$anon.this.gzipInputCrcBytes.+($anon.this.gzipInputSizeBytes) valzeroByte:Byte=0 valfileNameBytesSoftLimit:Int=1024 valfileCommentBytesSoftLimit:Int=1024.*(1024) defmoveAsChunkBytes(values:Array[Byte]):Chunk[Byte]=$anon.this.moveAsChunkBytes(values,values.length) defmoveAsChunkBytes(`values₂`:Array[Byte],length:Int):Chunk[Byte]=if(length.>(0))Chunk.array[Byte](`values₂`,0,length)(ClassTag.apply[Byte](classOf[Byte]))elseChunk.empty[Byte] defcopyAsChunkBytes(`values₃`:Array[Byte],`length₂`:Int):Chunk[Byte]=if(`length₂`.>(0)){ valtarget:Array[Byte]=newArray[Byte](`length₂`) System.arraycopy(`values₃`,0,target,0,`length₂`) Chunk.array[Byte](target,0,`length₂`)(ClassTag.apply[Byte](classOf[Byte])) }elseChunk.empty[Byte] defunsignedToInt(lsb:Byte,msb:Byte):Int=msb.&(255).<<(8).|(lsb.&(255)) defunsignedToLong(`lsb₂`:Byte,byte2:Byte,byte3:Byte,`msb₂`:Byte):Long=`msb₂`.toLong.&(255).<<(24).|(byte3.&(255).<<(16)).|(byte2.&(255).<<(8)).|(`lsb₂`.&(255)) } (new$anon():UnsealedCompression[F]) }">CompressionCompanionPlatform (hidden)
Source
CompressionPlatform.scala

Implicits

Inherited implicits

implicit def forLiftIO[F[_] : LiftIO]: Compression[F]

Deprecated and Inherited implicits

implicit def implicitForSync[F[_] : Sync]: Compression[F]

Attributes

Deprecated
true
Inherited from:
CompressionCompanionPlatformLowPriority (hidden)
Source
CompressionPlatform.scala