Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for SectionReader (0.17 sec)

  1. src/debug/pe/section.go

    // Section provides access to PE COFF section.
    type Section struct {
    	SectionHeader
    	Relocs []Reloc
    
    	// Embed ReaderAt for ReadAt method.
    	// Do not embed SectionReader directly
    	// to avoid having Read and Seek.
    	// If a client wants Read and Seek it must use
    	// Open() to avoid fighting over the seek offset
    	// with other clients.
    	io.ReaderAt
    	sr *io.SectionReader
    }
    
    // Data reads and returns the contents of the PE section s.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:33:30 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  2. test/fixedbugs/issue44266.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package p
    
    import "io"
    
    type T1 interface {
    	io.Reader
    }
    
    type T2 struct {
    	io.SectionReader
    }
    
    type T3 struct { // ERROR "invalid recursive type: T3 refers to itself"
    	T1
    	T2
    	parent T3
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 29 14:21:33 UTC 2022
    - 364 bytes
    - Viewed (0)
  3. src/io/io.go

    		// Assume we can read up to an offset of 1<<63 - 1.
    		remaining = maxint64
    	}
    	return &SectionReader{r, off, off, remaining, n}
    }
    
    // SectionReader implements Read, Seek, and ReadAt on a section
    // of an underlying [ReaderAt].
    type SectionReader struct {
    	r     ReaderAt // constant after creation
    	base  int64    // constant after creation
    	off   int64
    	limit int64 // constant after creation
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 17:34:10 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  4. src/internal/saferio/io_test.go

    	t.Run("maxint", func(t *testing.T) {
    		_, err := ReadDataAt(bytes.NewReader(input), 1<<62, 0)
    		if err == nil {
    			t.Error("large read succeeded unexpectedly")
    		}
    	})
    
    	t.Run("SectionReader", func(t *testing.T) {
    		// Reading 0 bytes from an io.SectionReader at the end
    		// of the section will return EOF, but ReadDataAt
    		// should succeed and return 0 bytes.
    		sr := io.NewSectionReader(bytes.NewReader(input), 0, 0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 31 00:34:05 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  5. src/debug/plan9obj/file.go

    	closer   io.Closer
    }
    
    // A SectionHeader represents a single Plan 9 a.out section header.
    // This structure doesn't exist on-disk, but eases navigation
    // through the object file.
    type SectionHeader struct {
    	Name   string
    	Size   uint32
    	Offset uint32
    }
    
    // A Section represents a single section in a Plan 9 a.out file.
    type Section struct {
    	SectionHeader
    
    	// Embed ReaderAt for ReadAt method.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:33:30 UTC 2023
    - 7.2K bytes
    - Viewed (0)
  6. src/internal/saferio/io.go

    		// a buffer large enough. Treat this as a read failure.
    		return nil, io.ErrUnexpectedEOF
    	}
    
    	if n < chunk {
    		buf := make([]byte, n)
    		_, err := r.ReadAt(buf, off)
    		if err != nil {
    			// io.SectionReader can return EOF for n == 0,
    			// but for our purposes that is a success.
    			if err != io.EOF || n > 0 {
    				return nil, err
    			}
    		}
    		return buf, nil
    	}
    
    	var buf []byte
    	buf1 := make([]byte, chunk)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 31 00:34:05 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  7. src/debug/macho/file.go

    	Scattered bool
    }
    
    type Section struct {
    	SectionHeader
    	Relocs []Reloc
    
    	// Embed ReaderAt for ReadAt method.
    	// Do not embed SectionReader directly
    	// to avoid having Read and Seek.
    	// If a client wants Read and Seek it must use
    	// Open() to avoid fighting over the seek offset
    	// with other clients.
    	io.ReaderAt
    	sr *io.SectionReader
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:33:30 UTC 2023
    - 17.9K bytes
    - Viewed (0)
  8. src/internal/xcoff/ar.go

    // ArchiveHeader holds information about a big archive file header
    type ArchiveHeader struct {
    	magic string
    }
    
    // Member represents a member of an AIX big archive.
    type Member struct {
    	MemberHeader
    	sr *io.SectionReader
    }
    
    // MemberHeader holds information about a big archive member
    type MemberHeader struct {
    	Name string
    	Size uint64
    }
    
    // OpenArchive opens the named archive using os.Open and prepares it for use
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:32:51 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  9. src/go/internal/gccgoimporter/ar.go

    			return nil, err
    		}
    	}
    }
    
    // elfFromAr tries to get export data from an archive member as an ELF file.
    // If there is no export data, this returns nil, nil.
    func elfFromAr(member *io.SectionReader) (io.ReadSeeker, error) {
    	ef, err := elf.NewFile(member)
    	if err != nil {
    		return nil, err
    	}
    	sec := ef.Section(".go_export")
    	if sec == nil {
    		return nil, nil
    	}
    	return sec.Open(), nil
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 30 14:14:36 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  10. src/mime/multipart/formdata.go

    type File interface {
    	io.Reader
    	io.ReaderAt
    	io.Seeker
    	io.Closer
    }
    
    // helper types to turn a []byte into a File
    
    type sectionReadCloser struct {
    	*io.SectionReader
    	io.Closer
    }
    
    func (rc sectionReadCloser) Close() error {
    	if rc.Closer != nil {
    		return rc.Closer.Close()
    	}
    	return nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 16:12:35 UTC 2024
    - 7.7K bytes
    - Viewed (0)
Back to top