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

Side by Side Diff: src/pkg/compress/lzw/writer.go

Issue 7079043: code review 7079043: all: use io.ByteWriter now that it exists (Closed)
Patch Set: diff -r 74e2affcfe39 https://go.googlecode.com/hg/ Created 12 years, 2 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 | « no previous file | src/pkg/exp/html/render.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 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 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 lzw 5 package lzw
6 6
7 import ( 7 import (
8 "bufio" 8 "bufio"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
11 "io" 11 "io"
12 ) 12 )
13 13
14 // A writer is a buffered, flushable writer. 14 // A writer is a buffered, flushable writer.
15 type writer interface { 15 type writer interface {
16 » WriteByte(byte) error 16 » io.ByteWriter
17 Flush() error 17 Flush() error
18 } 18 }
19 19
20 // An errWriteCloser is an io.WriteCloser that always returns a given error. 20 // An errWriteCloser is an io.WriteCloser that always returns a given error.
21 type errWriteCloser struct { 21 type errWriteCloser struct {
22 err error 22 err error
23 } 23 }
24 24
25 func (e *errWriteCloser) Write([]byte) (int, error) { 25 func (e *errWriteCloser) Write([]byte) (int, error) {
26 return 0, e.err 26 return 0, e.err
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 w: bw, 253 w: bw,
254 order: order, 254 order: order,
255 write: write, 255 write: write,
256 width: 1 + lw, 256 width: 1 + lw,
257 litWidth: lw, 257 litWidth: lw,
258 hi: 1<<lw + 1, 258 hi: 1<<lw + 1,
259 overflow: 1 << (lw + 1), 259 overflow: 1 << (lw + 1),
260 savedCode: invalidCode, 260 savedCode: invalidCode,
261 } 261 }
262 } 262 }
OLDNEW
« no previous file with comments | « no previous file | src/pkg/exp/html/render.go » ('j') | no next file with comments »

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