"use strict";function CompressedObject(e,r,t,s,o){this.compressedSize=e,this.uncompressedSize=r,this.crc32=t,this.compression=s,this.compressedContent=o}var external=require("./external"),DataWorker=require("./stream/DataWorker"),DataLengthProbe=require("./stream/DataLengthProbe"),Crc32Probe=require("./stream/Crc32Probe"),DataLengthProbe=require("./stream/DataLengthProbe");CompressedObject.prototype={getContentWorker:function(){var e=new DataWorker(external.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new DataLengthProbe("data_length")),r=this;return e.on("end",function(){if(this.streamInfo.data_length!==r.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new DataWorker(external.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},CompressedObject.createWorkerFrom=function(e,r,t){return e.pipe(new Crc32Probe).pipe(new DataLengthProbe("uncompressedSize")).pipe(r.compressWorker(t)).pipe(new DataLengthProbe("compressedSize")).withStreamInfo("compression",r)},module.exports=CompressedObject;