Handbook
Glossary
compress ( byte-array block-size/f -- byte-array' )
Vocabulary
compression
.
bzip3
Inputs
byte-array
a
byte-array
block-size/f
integer or
f
Outputs
byte-array'
a
byte-array
Word description
Takes a byte array and block size, and pushes a compressed byte array from bzip3.
Definition
USING:
alien.c-types
alien.data
byte-arrays
compression.bzip3.ffi
compression.bzip3.private
endian
kernel
sequences
;
IN:
compression.bzip3
::
compress
( byte-array block-size/f -- byte-array' )
byte-array
length
:>
in-size in-size
bz3_bound
:>
out-size
out-size
<byte-array>
:>
out block-size/f
[
dsize
]
unless*
validate-block-size
byte-array out in-size out-size
size_t
<ref>
bz3_compress
dup
0
=
[
drop
in-size 8
>be
out
append
]
[
throw-internal-error
]
if
;