SHARE
TWEET

Untitled

a guest Oct 21st, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var reader io.Reader
  2.     var UnCompressedData []byte
  3.  
  4.     gzipReader, err := gzip.NewReader(reader)
  5.     defer func() { _ = gzipReader.Close() }()
  6.     if err != nil {
  7.         log.Fatal(err)
  8.     }
  9.  
  10.     for {
  11.         // if Multistream is set false, It reads the gzip data as seperate stream
  12.         gzipReader.Multistream(false)
  13.         gzipReader.Read(UnCompressedData)
  14.  
  15.         err = gzipReader.Reset(reader)
  16.         if err == io.EOF {
  17.             break
  18.         }
  19.  
  20.         if err != nil {
  21.             log.Fatal(err)
  22.         }
  23.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top