CodecLZOP
Documentation for CodecLZOP.
CodecLZOP.LZOPCompressorCodecLZOP.LZOPCompressorStreamCodecLZOP.LZOPDecompressorCodecLZOP.LZOPDecompressorStreamCodecLZOP.compress_blockCodecLZOP.decompress_block
CodecLZOP.LZOPCompressor — TypeLZOPCompressor([algo=LZO1X_1]; <keyword arguments>) <: TranscodingStreams.CodecCompress data using the LZOP method.
Arguments
algo:LibLZO.AbstractLZOAlgorithm,Type{LibLZO.AbstractLZOAlgorithm},Symbol, orAbstractStringdescribing the LZO algorithm to use when compressing the data.
Keyword Arguments
block_size::Integer = LZOP_DEFAULT_BLOCK_SIZE: the maximum size of each block into which the input data will be split before compressing with LZO. Cannot be greater than64 * 2^20(64 MB).uncompressed_checksum::Union{Symbol, Nothing} = :adler32: can be any of the following values::adler32: write an Adler32 checksum of the uncompressed data (default).:crc32: write a CRC32 checksum of the uncompressed data.nothing: do not write a checksum of the uncompressed data.
compressed_checksum::Union{Symbol, Nothing} = nothing: can be any of the following values::adler32: write an Adler32 checksum of the compressed data.:crc32: write a CRC32 checksum of the compressed data.nothing: do not write a checksum of the compressed data (default).
filter::Function = identity: a function applied to the compressed data as it is streamed. The function must take a singleAbstractVector{UInt8}argument and modify it in place without changing its size.optimize::Bool = false: whether to run the LZO optimization function on compressed data before writing it to the stream. Optimization doubles the compression time and rarely results in improved compression ratios, so it is disabled by default.
CodecLZOP.LZOPCompressorStream — TypeLZOPCompressorStream(io, [algo=LZO1X_1]; <keyword arguments>) <: TranscodingStreams.TranscodingStreamCompress stream using the LZOP method.
Arguments
io::IO: stream to compress.algo:LibLZO.AbstractLZOAlgorithm,Type{LibLZO.AbstractLZOAlgorithm},Symbol, orAbstractStringdescribing the LZO algorithm to use when compressing the data.
Keyword Arguments
block_size::Integer = LZOP_DEFAULT_BLOCK_SIZE: the maximum size of each block into which the input data will be split before compressing with LZO. Cannot be greater than64 * 2^20(64 MB).uncompressed_checksum::Union{Symbol, Nothing} = :adler32: can be any of the following values::adler32: write an Adler32 checksum of the uncompressed data (default).:crc32: write a CRC32 checksum of the uncompressed data.nothing: do not write a checksum of the uncompressed data.
compressed_checksum::Union{Symbol, Nothing} = nothing: can be any of the following values::adler32: write an Adler32 checksum of the compressed data.:crc32: write a CRC32 checksum of the compressed data.nothing: do not write a checksum of the compressed data (default).
filter::Function = identity: a function applied to the compressed data as it is streamed. The function must take a singleAbstractVector{UInt8}argument and modify it in place without changing its size.optimize::Bool = false: whether to run the LZO optimization function on compressed data before writing it to the stream. Optimization doubles the compression time and rarely results in improved compression ratios, so it is disabled by default.
All other keyword arguments are passed unmodified to the TranscodingStream constructor.
CodecLZOP.LZOPDecompressor — TypeLZOPDecompressor([algo=LZO1X_1]; <keyword arguments>) <: TranscodingStreams.CodecDexompress data using the LZOP method.
Arguments
algo:LibLZO.AbstractLZOAlgorithm,Type{LibLZO.AbstractLZOAlgorithm},Symbol, orAbstractStringdescribing the LZO algorithm to use when decompressing the data. The decompression algorithm must match the algorithm used to compress the data.
Keyword Arguments
uncompressed_checksum::Union{Symbol, Nothing} = :adler32: can be any of the following values::adler32: expect and decode an Adler32 checksum of the uncompressed data (default).:crc32: expect and decode a CRC32 checksum of the uncompressed data.nothing: expect no checksum of the uncompressed data.
compressed_checksum::Union{Symbol, Nothing} = nothing: can be any of the following values::adler32: expect and decode an Adler32 checksum of the compressed data.:crc32: expect and decode a CRC32 checksum of the compressed data.nothing: expect no checksum of the compressed data (default).
filter::Function = identity: a function applied to the decompressed data as it is streamed. The function must take a singleAbstractVector{UInt8}argument and modify it in place without changing its size.on_checksum_fail::Symbol = :throw: a flag to determine how checksum failures are handled.:throwwill cause anErrorExceptionto be thrown,:warnwill log a warning using the@warnmacro, and:ignorewill silently ignore the failure.
CodecLZOP.LZOPDecompressorStream — TypeLZOPDecompressorStream(io, [algo=LZO1X_1]; <keyword arguments>) <: TranscodingStreams.TranscodingStreamDexompress data using the LZOP method.
Arguments
io::IO: stream to decompress.algo:LibLZO.AbstractLZOAlgorithm,Type{LibLZO.AbstractLZOAlgorithm},Symbol, orAbstractStringdescribing the LZO algorithm to use when decompressing the data. The decompression algorithm must match the algorithm used to compress the data.
Keyword Arguments
uncompressed_checksum::Union{Symbol, Nothing} = :adler32: can be any of the following values::adler32: expect and decode an Adler32 checksum of the uncompressed data (default).:crc32: expect and decode a CRC32 checksum of the uncompressed data.nothing: expect no checksum of the uncompressed data.
compressed_checksum::Union{Symbol, Nothing} = nothing: can be any of the following values::adler32: expect and decode an Adler32 checksum of the compressed data.:crc32: expect and decode a CRC32 checksum of the compressed data.nothing: expect no checksum of the compressed data (default).
filter::Function = identity: a function applied to the decompressed data as it is streamed. The function must take a singleAbstractVector{UInt8}argument and modify it in place without changing its size.on_checksum_fail::Symbol = :throw: a flag to determine how checksum failures are handled.:throwwill cause anErrorExceptionto be thrown,:warnwill log a warning using the@warnmacro, and:ignorewill silently ignore the failure.
All other keyword arguments are passed unmodified to the TranscodingStream constructor.
CodecLZOP.compress_block — Methodcompress_block(input, output, algo; [kwargs...])::Tuple{Int,Int}Compress a block of data from input to output using LZO algorithm algo, returning the number of bytes read from input and written to output.
Arguments
input: AnAbstractVector{UInt8}orIOobject containing the block of data to compress.output::IO: Output IO object to write the compressed block.
Keyword arguments
block_size::Integer = LZOP_DEFAULT_BLOCK_SIZE: Number of bytes to read frominput. Will cap atLZOP_MAX_BLOCK_SIZE.uncompressed_checksum::Union{Symbol, Nothing} = :adler32: can be any of the following values::adler32: write an Adler32 checksum of the uncompressed data (default).:crc32: write a CRC32 checksum of the uncompressed data.nothing: do not write a checksum of the uncompressed data.
compressed_checksum::Union{Symbol, Nothing} = nothing: can be any of the following values::adler32: write an Adler32 checksum of the compressed data.:crc32: write a CRC32 checksum of the compressed data.nothing: do not write a checksum of the compressed data (default).
filter_function::Function = identity: Transform the input data using the specified filter functions. The filter function must accept a singleAbstractVector{UInt8}argument and must modify that vector in-place.optimize::Bool = false: Iftrue, process the data twice to optimize how it is stored for faster decompression. Setting this totruedoubles compression time with little to no improvement in decompression time, so its use is not recommended.
CodecLZOP.decompress_block — Methoddecompress_block(input, output, algo; [kwargs...])::Tuple{Int,Int}Decompress a block of data from input to output using LZO algorithm algo, returning the number of bytes read from input and written to output.
Arguments
input: AnAbstractVector{UInt8}orIOobject containing the block of LZO-compressed data to decompress.output::IO: Output IO object to write the decompressed block.
Keyword arguments
uncompressed_checksum::Union{Symbol, Nothing} = :adler32: can be any of the following values::adler32: expect and decode an Adler32 checksum of the uncompressed data (default).:crc32: expect and decode a CRC32 checksum of the uncompressed data.nothing: expect no checksum of the uncompressed data.
compressed_checksum::Union{Symbol, Nothing} = nothing: can be any of the following values::adler32: expect and decode an Adler32 checksum of the compressed data.:crc32: expect and decode a CRC32 checksum of the compressed data.nothing: expect no checksum of the compressed data (default).
filter_function::Function = identity: Untransform the output data using the specified filter function. The filter function must take a singleAbstractVector{UInt8}argument and modify it in place.on_checksum_fail::Symbol = :throw: Choose how the function responds to invalud checksums. If:throw, anErrorExceptionwill be thrown. If:warn, a warning will be printed. If:ignore, the checksum values will be completely ignored.