~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/compress/gzip/gzip.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        Header
29
29
        w          io.Writer
30
30
        level      int
31
 
        compressor io.WriteCloser
 
31
        compressor *flate.Writer
32
32
        digest     hash.Hash32
33
33
        size       uint32
34
34
        closed     bool
191
191
        return n, z.err
192
192
}
193
193
 
 
194
// Flush flushes any pending compressed data to the underlying writer.
 
195
//
 
196
// It is useful mainly in compressed network protocols, to ensure that
 
197
// a remote reader has enough data to reconstruct a packet. Flush does
 
198
// not return until the data has been written. If the underlying
 
199
// writer returns an error, Flush returns that error.
 
200
//
 
201
// In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH.
 
202
func (z *Writer) Flush() error {
 
203
        if z.err != nil {
 
204
                return z.err
 
205
        }
 
206
        if z.closed {
 
207
                return nil
 
208
        }
 
209
        if z.compressor == nil {
 
210
                z.Write(nil)
 
211
        }
 
212
        z.err = z.compressor.Flush()
 
213
        return z.err
 
214
}
 
215
 
194
216
// Close closes the Writer. It does not close the underlying io.Writer.
195
217
func (z *Writer) Close() error {
196
218
        if z.err != nil {