···147147 return false, err
148148}
149149150150+const (
151151+ byteBufferSize = 32 * 1024 // from io.Copy
152152+ lineBufferSize = 32
153153+)
154154+150155// copyFrom writes bytes starting from offset off in src to dst stopping at the
151156// end of src or at the first error. copyFrom returns the number of bytes
152157// written and any error.
153158func copyFrom(dst io.Writer, src io.ReaderAt, off int64) (written int64, err error) {
154154- buf := make([]byte, 32*1024) // stolen from io.Copy
159159+ buf := make([]byte, byteBufferSize)
155160 for {
156161 nr, rerr := src.ReadAt(buf, off)
157162 if nr > 0 {
···167172 err = io.ErrShortWrite
168173 break
169174 }
175175+ off += int64(nr)
170176 }
171177 if rerr != nil {
172178 if rerr != io.EOF {
···182188// the end of src or at the first error. copyLinesFrom returns the number of
183189// lines written and any error.
184190func copyLinesFrom(dst io.Writer, src LineReaderAt, off int64) (written int64, err error) {
185185- buf := make([][]byte, 32)
191191+ buf := make([][]byte, lineBufferSize)
186192ReadLoop:
187193 for {
188194 nr, rerr := src.ReadLinesAt(buf, off)
···201207 break ReadLoop
202208 }
203209 }
210210+ off += int64(nr)
204211 }
205212 if rerr != nil {
206213 if rerr != io.EOF {