---
layout: doc
title: general / uncompress
---
# uncompress

### NAME

    uncompress() - uncompress a zlib-compressed buffer

### SYNOPSIS

    buffer uncompress( buffer data );

### DESCRIPTION

    Uncompresses a zlib-compressed buffer and returns the uncompressed bytes
    in a new buffer.

    The current driver implementation accepts a buffer.  If the argument is
    not a buffer, undefined is returned.  If zlib cannot finish inflating the
    supplied buffer, an error is raised.

    This efun performs in-memory zlib decompression.  It does not read from
    the filesystem and does not process gzip files by filename.  Use
    uncompress_file() to expand a gzip file on disk.

### SEE ALSO

    compress(3), compress_file(3), uncompress_file(3),
    allocate_buffer(3), read_buffer(3), write_buffer(3)
