Figured out it was the filters for XZ that was causing problems

Added lzma and xz decompression.
Renamed Zlib to Gzip
This commit is contained in:
Caleb Gardner
2020-12-04 05:36:58 -06:00
parent a894e2efb9
commit 89b0a41ab9
6 changed files with 101 additions and 15 deletions
+25
View File
@@ -0,0 +1,25 @@
package compression
import (
"bytes"
"io"
"github.com/ulikunitz/xz/lzma"
)
//Lzma is a lzma decompressor
type Lzma struct{}
//Decompress decompresses all the data in the given reader and returns the uncompressed bytes.
func (l *Lzma) Decompress(rdr io.Reader) ([]byte, error) {
r, err := lzma.NewReader(rdr)
if err != nil {
return nil, err
}
var buf bytes.Buffer
_, err = io.Copy(&buf, r)
if err != nil {
return nil, err
}
return buf.Bytes(), nil
}