Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for tryReadFull (0.21 sec)

  1. src/archive/tar/reader.go

    func mustReadFull(r io.Reader, b []byte) (int, error) {
    	n, err := tryReadFull(r, b)
    	if err == io.EOF {
    		err = io.ErrUnexpectedEOF
    	}
    	return n, err
    }
    
    // tryReadFull is like io.ReadFull except it returns
    // io.EOF when it is hit before len(b) bytes are read.
    func tryReadFull(r io.Reader, b []byte) (n int, err error) {
    	for len(b) > n && err == nil {
    		var nn int
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Mar 08 01:59:14 UTC 2024
    - 26.8K bytes
    - Viewed (0)
  2. src/archive/tar/writer.go

    		if c != 0 {
    			return i, errWriteHole
    		}
    	}
    	return len(b), nil
    }
    
    // ensureEOF checks whether r is at EOF, reporting ErrWriteTooLong if not so.
    func ensureEOF(r io.Reader) error {
    	n, err := tryReadFull(r, []byte{0})
    	switch {
    	case n > 0:
    		return ErrWriteTooLong
    	case err == io.EOF:
    		return nil
    	default:
    		return err
    	}
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Wed Oct 02 14:22:59 UTC 2024
    - 19.6K bytes
    - Viewed (0)
Back to top