Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(270)

Side by Side Diff: src/pkg/compress/gzip/gunzip.go

Issue 4607052: code review 4607052: os.Error API: don't export os.ErrorString, use os.NewEr... (Closed)
Patch Set: diff -r 6e3e06fb2dc3 https://go.googlecode.com/hg/ Created 13 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/bytes/buffer.go ('k') | src/pkg/compress/zlib/reader.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Package gzip implements reading and writing of gzip format compressed files, 5 // Package gzip implements reading and writing of gzip format compressed files,
6 // as specified in RFC 1952. 6 // as specified in RFC 1952.
7 package gzip 7 package gzip
8 8
9 import ( 9 import (
10 "bufio" 10 "bufio"
(...skipping 18 matching lines...) Expand all
29 flagComment = 1 << 4 29 flagComment = 1 << 4
30 ) 30 )
31 31
32 func makeReader(r io.Reader) flate.Reader { 32 func makeReader(r io.Reader) flate.Reader {
33 if rr, ok := r.(flate.Reader); ok { 33 if rr, ok := r.(flate.Reader); ok {
34 return rr 34 return rr
35 } 35 }
36 return bufio.NewReader(r) 36 return bufio.NewReader(r)
37 } 37 }
38 38
39 var HeaderError os.Error = os.ErrorString("invalid gzip header") 39 var HeaderError = os.NewError("invalid gzip header")
40 var ChecksumError os.Error = os.ErrorString("gzip checksum error") 40 var ChecksumError = os.NewError("gzip checksum error")
41 41
42 // The gzip file stores a header giving metadata about the compressed file. 42 // The gzip file stores a header giving metadata about the compressed file.
43 // That header is exposed as the fields of the Compressor and Decompressor struc ts. 43 // That header is exposed as the fields of the Compressor and Decompressor struc ts.
44 type Header struct { 44 type Header struct {
45 Comment string // comment 45 Comment string // comment
46 Extra []byte // "extra data" 46 Extra []byte // "extra data"
47 Mtime uint32 // modification time (seconds since January 1, 1970) 47 Mtime uint32 // modification time (seconds since January 1, 1970)
48 Name string // file name 48 Name string // file name
49 OS byte // operating system type 49 OS byte // operating system type
50 } 50 }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 222
223 // Yes. Reset and read from it. 223 // Yes. Reset and read from it.
224 z.digest.Reset() 224 z.digest.Reset()
225 z.size = 0 225 z.size = 0
226 return z.Read(p) 226 return z.Read(p)
227 } 227 }
228 228
229 // Calling Close does not close the wrapped io.Reader originally passed to NewRe ader. 229 // Calling Close does not close the wrapped io.Reader originally passed to NewRe ader.
230 func (z *Decompressor) Close() os.Error { return z.decompressor.Close() } 230 func (z *Decompressor) Close() os.Error { return z.decompressor.Close() }
OLDNEW
« no previous file with comments | « src/pkg/bytes/buffer.go ('k') | src/pkg/compress/zlib/reader.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b