Lines Matching refs:r
25 r io.ReaderAt member
59 r := new(ReadCloser)
60 if err := r.init(f, fi.Size()); err != nil {
64 r.f = f
65 return r, nil
70 func NewReader(r io.ReaderAt, size int64) (*Reader, error) {
72 if err := zr.init(r, size); err != nil {
78 func (z *Reader) init(r io.ReaderAt, size int64) error {
79 end, err := readDirectoryEnd(r, size)
86 z.r = r
89 rs := io.NewSectionReader(r, 0, size)
100 f := &File{zip: z, zipr: r, zipsize: size}
162 r := io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset, size)
167 var rc io.ReadCloser = dcomp(r)
190 func (r *checksumReader) Read(b []byte) (n int, err error) {
191 if r.err != nil {
192 return 0, r.err
194 n, err = r.rc.Read(b)
195 r.hash.Write(b[:n])
196 r.nread += uint64(n)
201 if r.nread != r.f.UncompressedSize64 {
204 if r.desr != nil {
205 if err1 := readDataDescriptor(r.desr, r.f); err1 != nil {
211 } else if r.hash.Sum32() != r.f.CRC32 {
218 if r.f.CRC32 != 0 && r.hash.Sum32() != r.f.CRC32 {
223 r.err = err
227 func (r *checksumReader) Close() error { return r.rc.Close() }
249 func readDirectoryHeader(f *File, r io.Reader) error {
251 if _, err := io.ReadFull(r, buf[:]); err != nil {
276 if _, err := io.ReadFull(r, d); err != nil {
349 func readDataDescriptor(r io.Reader, f *File) error {
362 if _, err := io.ReadFull(r, buf[:4]); err != nil {
372 if _, err := io.ReadFull(r, buf[off:12]); err != nil {
389 func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, err error) {
398 if _, err := r.ReadAt(buf, size-bLen); err != nil && err != io.EOF {
430 p, err := findDirectory64End(r, directoryEndOffset)
432 err = readDirectory64End(r, p, d)
448 func findDirectory64End(r io.ReaderAt, directoryEndOffset int64) (int64, error) {
454 if _, err := r.ReadAt(buf, locOffset); err != nil {
473 func readDirectory64End(r io.ReaderAt, offset int64, d *directoryEnd) (err error) {
475 if _, err := r.ReadAt(buf, offset); err != nil {