Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for mustReadFull (0.17 sec)

  1. src/archive/tar/reader.go

    }
    
    type zeroReader struct{}
    
    func (zeroReader) Read(b []byte) (int, error) {
    	clear(b)
    	return len(b), nil
    }
    
    // mustReadFull is like io.ReadFull except it returns
    // io.ErrUnexpectedEOF when io.EOF is hit before len(b) bytes are read.
    func mustReadFull(r io.Reader, b []byte) (int, error) {
    	n, err := tryReadFull(r, b)
    	if err == io.EOF {
    		err = io.ErrUnexpectedEOF
    	}
    	return n, err
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  2. src/archive/tar/writer.go

    		}
    	}
    
    	// If the last fragment is a hole, then seek to 1-byte before EOF, and
    	// read a single byte to ensure the file is the right size.
    	if readLastByte && err == nil {
    		_, err = mustReadFull(rs, []byte{0})
    		sw.pos++
    	}
    
    	n = sw.pos - pos0
    	switch {
    	case err == io.EOF:
    		return n, io.ErrUnexpectedEOF
    	case err == ErrWriteTooLong:
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
Back to top