diff --git a/README.md b/README.md index 5940fdc6..67831dfd 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,27 @@ zip_stream_close(zip); free(buf); ``` +* Extract a partial zip entry + +```c +unsigned char buf[16]; +size_t bufsize = sizeof(buf); + +struct zip_t *zip = zip_open("foo.zip", 0, 'r'); +{ + zip_entry_open(zip, "foo-1.txt"); + { + size_t offset = 4; + ssize_t nread = zip_entry_noallocread_offset(zip, offset, bufsize, (void *)buf); + } + + zip_entry_close(zip); +} +zip_close(zip); + +free(buf); +``` + * List of all zip entries ```c