Lines Matching refs:buf
25 buf := new(bytes.Buffer)
26 w := NewWriter(buf)
40 s := buf.String()
123 buf []repeatedByte member
127 if len(r.buf) == 0 {
130 last := &r.buf[len(r.buf)-1]
136 if len(r.buf) > 0 {
137 rp = &r.buf[len(r.buf)-1]
156 r.buf = append(r.buf, repeatedByte{r.Size(), b, 1})
157 rp = &r.buf[len(r.buf)-1]
169 skipParts := sort.Search(len(r.buf), func(i int) bool {
170 part := &r.buf[i]
173 parts := r.buf[skipParts:]
204 if len(b.buf) != 10 {
205 t.Fatalf("len(b.buf) = %d; want 10", len(b.buf))
210 buf := make([]byte, j)
211 n, err := b.ReadAt(buf, int64(i))
212 if err != nil || n != len(buf) {
213 t.Errorf("ReadAt(%d, %d) = %d, %v; want %d, nil", i, j, n, err, len(buf))
215 if !bytes.Equal(buf, all[i:i+j]) {
216 t.Errorf("ReadAt(%d, %d) = %q; want %q", i, j, buf, all[i:i+j])
235 buf := testZip64(t, size)
236 testZip64DirectoryRecordLength(buf, t)
249 buf := testZip64(t, size)
250 testZip64DirectoryRecordLength(buf, t)
257 buf := new(rleBuffer)
258 w := NewWriter(buf)
293 r, err := NewReader(buf, int64(buf.Size()))
336 return buf
340 func testZip64DirectoryRecordLength(buf *rleBuffer, t *testing.T) {
342 if _, err := buf.ReadAt(d, buf.Size()-int64(len(d))); err != nil {
347 dirOff, err := findDirectory64End(buf, buf.Size()-int64(len(d))+int64(sigOff))
353 if _, err := buf.ReadAt(d, dirOff); err != nil {
369 var buf bytes.Buffer
370 z := NewWriter(&buf)
383 b := buf.Bytes()