úÎ{bvF     portable (H98 + FFI) experimentalduncan.coutts@worc.ox.ac.ukQThe 9 parameter is a number between 0 and 4. 0 is silent, and 5 greater numbers give increasingly verbose monitoring/debugging output. "A specific level between 0 and 4.  No output. This is the default. The ; parameter controls how the compression phase behaves when J presented with worst case, highly repetitive, input data. If compression M runs into difficulties caused by repetitive data, the library switches from I the standard sorting algorithm to a fallback algorithm. The fallback is M slower than the standard algorithm by perhaps a factor of three, but always 2 behaves reasonably, no matter how bad the input. Lower values of * reduce the amount of effort the standard M algorithm will expend before resorting to the fallback. You should set this F parameter carefully; too low, and many inputs will be handled by the F fallback algorithm and so compress rather slowly, too high, and your L average-to-worst case compression times can become very large. The default L value of 30 gives reasonable behaviour over a wide range of circumstances. E Note that the compressed output generated is the same regardless of 0 whether or not the fallback algorithm is used. 0Allowable values range from 1 to 250 inclusive. The default work factor is 30. JFor files compressed with the default 900k block size, decompression will L require about 3700k to decompress. To support decompression of any file in J less than 4Mb there is the option to decompress using approximately half I this amount of memory, about 2300k. Decompression speed is also halved, 6 so you should use this option only where necessary. .Use minimum memory dusing decompression. This 0 halves the memory needed but also halves the  decompression speed.  The default. KThe block size affects both the compression ratio achieved, and the amount 5 of memory needed for compression and decompression.  1 through  9& specify the block size to be 100,000 M bytes through 900,000 bytes respectively. The default is to use the maximum  block size. JLarger block sizes give rapidly diminishing marginal returns. Most of the J compression comes from the first two or three hundred k of block size, a K fact worth bearing in mind when using bzip2 on small machines. It is also M important to appreciate that the decompression memory requirement is set at / compression time by the choice of block size. J In general, try and use the largest block size memory constraints allow, 0 since that maximises the compression achieved. G Compression and decompression speed are virtually unaffected by block  size. IAnother significant point applies to files which fit in a single block -  that means most files you'1d encounter using a large block size. The amount K of real memory touched is proportional to the size of the file, since the L file is smaller than a block. For example, compressing a file 20,000 bytes  long with the flag  9' will cause the compressor to allocate M around 7600k of memory, but only touch 400k + 20000 * 8 = 560 kbytes of it. M Similarly, the decompressor will allocate 3700k but only touch 100k + 20000  * 4 = 180 kbytes. 'A specific block size between 1 and 9. ,The default block size is also the maximum.  !"#$9Compression of data was completed, or the logical stream * end was detected during decompression. %1The requested action was completed successfully. &'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a)This never needs to be used as the stream's resources will be released J automatically when no longer needed, however this can be used to release J them early. Only use this when you can guarantee that the stream will no I longer be needed, for example if an error occurs or if the stream ends. & !"#$%&/01234567<=>HIJ]^a&"! !"#%$$%&/01234567<=>HIJ]^aportable (H98 + FFI) provisionalduncan@haskell.org ?The full set of parameters for decompression. The defaults are  . The  ) is the size of the first output buffer, M containing the uncompressed data. If you know an exact or approximate upper L bound on the size of the decompressed data then setting this parameter can > save memory. The default decompression output buffer size is 32k . If your M extimate is wrong it does not matter too much, the default buffer size will # be used for the remaining chunks. (One particular use case for setting the   is if you K know the exact size of the decompressed data and want to produce a strict  Data.ByteString.ByteString/. The compression and deccompression functions  use lazy Data.ByteString.Lazy.ByteStrings but if you set the   ( correctly then you can generate a lazy  Data.ByteString.Lazy.ByteString& with exactly one chunk, which can be  converted to a strict Data.ByteString.ByteString in O(1) time using  Data.ByteString.concat . Data.ByteString.Lazy.toChunks. =The full set of parameters for compression. The defaults are  . The 3 is the size of the first output buffer containing L the compressed data. If you know an approximate upper bound on the size of N the compressed data then setting this parameter can save memory. The default # compression output buffer size is 16k$. If your extimate is wrong it does M not matter too much, the default buffer size will be used for the remaining  chunks. KThe default set of parameters for compression. This is typically used with  the  compressWith/ function with specific paramaters overridden. MThe default set of parameters for decompression. This is typically used with  the  compressWith/ function with specific paramaters overridden. bHThe default chunk sizes for the output of compression and decompression B are 16k and 32k respectively (less a small accounting overhead). cHThe default chunk sizes for the output of compression and decompression B are 16k and 32k respectively (less a small accounting overhead).      portable (H98 + FFI) provisionalduncan@haskell.org1Decompress a stream of data in the bzip2 format. LThere are a number of errors that can occur. In each case an exception will / be thrown. The possible error conditions are: 7 if the stream does not start with a valid gzip header ' if the compressed stream is corrupted + if the compressed stream ends permaturely )Note that the decompression is performed lazily. Errors in the data stream J may not be detected until the end of the stream is demanded (since it is E only at the end that the final checksum can be checked). If this is H important to you, you must make sure to consume the whole decompressed 7 stream before doing any IO action that depends on it. Like 7 but with the ability to specify various decompression  parameters. Typical usage: 0 decompressWith defaultDecompressParams { ... } 1Compress a stream of data into the bzip2 format. KThis uses the default compression level which uses the largest compression 3 block size for the highest compression level. Use  to adjust  the compression block size. Like 9 but with the ability to specify compression parameters.  Typical usage:  , compressWith defaultCompressParams { ... } 6In particular you can set the compression block size: H compressWith defaultCompressParams { compressBlockSize = BlockSize 1 }    d        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ bzlib-0.5.0.2Codec.Compression.BZip.InternalCodec.Compression.BZipCodec.Compression.BZip.Stream WorkFactorDefaultWorkFactor MemoryLevelMinMemoryLevelDefaultMemoryLevel BlockSizeDefaultBlockSizeDecompressParamsdecompressMemoryLeveldecompressBufferSizeCompressParamscompressBlockSizecompressWorkFactorcompressBufferSizedefaultCompressParamsdefaultDecompressParamscompress decompressdecompressWith compressWith StreamState VerbositySilentActionFinishFlushRunStatus StreamEndOkStreamBZunZ bzCompressEnd bzCompressbzCompressInitbzDecompressEnd bzDecompressbzDecompressInitpushInputBufferinputBufferEmptypushOutputBufferpopOutputBufferoutputBufferBytesAvailableoutputBufferSpaceRemainingoutputBufferFullreturnZthenZthenZ_failZrun unsafeLiftIOunsafeInterleavegetStreamStategetInBuf getOutBuf getOutOffset getOutAvailsetInBuf setOutBuf setOutOffset setOutAvailtracedumpconsistencyChecktoStatus failIfErrorgetErrorMessage fromAction fromBlockSizefromMemoryLevelfromWorkFactor fromVerbosity withStreamPtrwithStreamState setInAvail getInAvail setInNext getInNext setOutFree getOutFree setOutNext getOutNextdecompressInit compressInit decompress_ compress_finalisedefaultCompressBufferSizedefaultDecompressBufferSize