racket/collects/web-server/private/gzip.ss
Eli Barzilay d1a0086471 newlines at EOFs
svn: r13105
2009-01-14 03:10:47 +00:00

21 lines
462 B
Scheme

#lang scheme
(require file/gzip
file/gunzip)
(provide/contract
[gzip/bytes (bytes? . -> . bytes?)]
[gunzip/bytes (bytes? . -> . bytes?)])
(define (gzip/bytes b)
(define gzb-p (open-output-bytes))
(gzip-through-ports
(open-input-bytes b)
gzb-p #f (current-seconds))
(get-output-bytes gzb-p))
(define (gunzip/bytes gzb)
(define b-p (open-output-bytes))
(gunzip-through-ports
(open-input-bytes gzb) b-p)
(get-output-bytes b-p))