Commit 828c7bbe authored by Jonny Schäfer's avatar Jonny Schäfer
Browse files

NewComposites: Use bzip2 instead of gzip

parent 7ca845ce
...@@ -21,7 +21,7 @@ package radolan ...@@ -21,7 +21,7 @@ package radolan
import ( import (
"archive/tar" "archive/tar"
"bufio" "bufio"
"compress/gzip" "compress/bzip2"
"fmt" "fmt"
"io" "io"
"sort" "sort"
...@@ -132,16 +132,12 @@ func NewComposite(rd io.Reader) (comp *Composite, err error) { ...@@ -132,16 +132,12 @@ func NewComposite(rd io.Reader) (comp *Composite, err error) {
return return
} }
// NewComposites reads tar gz data from rd and returns the parsed composites sorted by // NewComposites reads .tar.bz2 data from rd and returns the parsed composites sorted by
// ForecastTime in ascending order. // ForecastTime in ascending order.
func NewComposites(rd io.Reader) ([]*Composite, error) { func NewComposites(rd io.Reader) ([]*Composite, error) {
gzipReader, err := gzip.NewReader(rd) bzipReader := bzip2.NewReader(rd)
if err != nil {
return nil, err
}
defer gzipReader.Close()
tarReader := tar.NewReader(gzipReader) tarReader := tar.NewReader(bzipReader)
var cs []*Composite var cs []*Composite
for { for {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment