Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 791 for readArg (0.2 sec)

  1. src/net/http/sniff_test.go

    				if n != 1 || err != nil {
    					t.Errorf("w.Write(%q) = %v, %v want 1, nil", input, n, err)
    				}
    			}
    		},
    	}, {
    		name: "copy from Reader",
    		handler: func(w ResponseWriter, r *Request) {
    			// Use io.Copy from a plain Reader.
    			type readerOnly struct{ io.Reader }
    			buf := bytes.NewBuffer([]byte(input))
    			n, err := io.Copy(w, readerOnly{buf})
    			if int(n) != len(input) || err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 07 16:53:14 UTC 2022
    - 9.6K bytes
    - Viewed (0)
  2. src/internal/zstd/literals.go

    		return 0, nil, err
    	}
    
    	return roff, outbuf, nil
    }
    
    // readLiteralsOneStream reads a single stream of compressed literals.
    func (r *Reader) readLiteralsOneStream(data block, off, compressedSize, regeneratedSize int, outbuf []byte) ([]byte, error) {
    	// We let the reverse bit reader read earlier bytes,
    	// because the Huffman table ignores bits that it doesn't need.
    	rbr, err := r.makeReverseBitReader(data, off+compressedSize-1, off-2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 09 14:30:10 UTC 2023
    - 8.8K bytes
    - Viewed (0)
  3. cmd/gotemplate/gotemplate.go

    	if err := generate(os.Stdin, os.Stdout, kvs); err != nil {
    		fmt.Fprintf(os.Stderr, "Error: %v\n", err)
    		os.Exit(1)
    	}
    }
    
    func generate(in io.Reader, out io.Writer, data interface{}) error {
    	var buf bytes.Buffer
    	if _, err := buf.ReadFrom(in); err != nil {
    		return fmt.Errorf("reading input: %v", err)
    	}
    
    	funcMap := template.FuncMap{
    		"include": include,
    		"indent":  indent,
    		"trim":    trim,
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 22 18:39:23 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  4. src/encoding/gob/decoder.go

    	err          error
    }
    
    // NewDecoder returns a new decoder that reads from the [io.Reader].
    // If r does not also implement [io.ByteReader], it will be wrapped in a
    // [bufio.Reader].
    func NewDecoder(r io.Reader) *Decoder {
    	dec := new(Decoder)
    	// We use the ability to read bytes as a plausible surrogate for buffering.
    	if _, ok := r.(io.ByteReader); !ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 7.2K bytes
    - Viewed (0)
  5. src/net/udpsock_plan9.go

    	}
    	if m < udpHeaderSize {
    		return 0, netip.AddrPort{}, errors.New("short read reading UDP header")
    	}
    	buf = buf[:m]
    
    	h, buf := unmarshalUDPHeader(buf)
    	n := copy(b, buf)
    	ip, _ := netip.AddrFromSlice(h.raddr)
    	addr := netip.AddrPortFrom(ip, h.rport)
    	return n, addr, nil
    }
    
    func (c *UDPConn) readMsg(b, oob []byte) (n, oobn, flags int, addr netip.AddrPort, err error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 02 18:35:35 UTC 2021
    - 4.6K bytes
    - Viewed (0)
  6. pkg/file/file.go

    // limitations under the License.
    
    package file
    
    import (
    	"bytes"
    	"errors"
    	"fmt"
    	"io"
    	"io/fs"
    	"os"
    	"path/filepath"
    )
    
    // AtomicCopy copies file by reading the file then writing atomically into the target directory
    func AtomicCopy(srcFilepath, targetDir, targetFilename string) error {
    	in, err := os.Open(srcFilepath)
    	if err != nil {
    		return err
    	}
    	defer in.Close()
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 11 21:42:29 UTC 2024
    - 3K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/io/CharSink.java

          closer.close();
        }
      }
    
      /**
       * Writes all the text from the given {@link Readable} (such as a {@link Reader}) to this sink.
       * Does not close {@code readable} if it is {@code Closeable}.
       *
       * @return the number of characters written
       * @throws IOException if an I/O error occurs while reading from {@code readable} or writing to
       *     this sink
       */
      @CanIgnoreReturnValue
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Feb 28 20:13:02 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  8. src/go/parser/interface.go

    // otherwise it returns an error. If src == nil, readSource returns
    // the result of reading the file specified by filename.
    func readSource(filename string, src any) ([]byte, error) {
    	if src != nil {
    		switch s := src.(type) {
    		case string:
    			return []byte(s), nil
    		case []byte:
    			return s, nil
    		case *bytes.Buffer:
    			// is io.Reader, but src is already available in []byte form
    			if s != nil {
    				return s.Bytes(), nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  9. src/cmd/pprof/readlineui.go

    	if err != nil {
    		return nil
    	}
    	term.Restore(0, oldState)
    
    	rw := struct {
    		io.Reader
    		io.Writer
    	}{os.Stdin, os.Stderr}
    	return &readlineUI{term: term.NewTerminal(rw, "")}
    }
    
    // ReadLine returns a line of text (a command) read from the user.
    // prompt is printed before reading the command.
    func (r *readlineUI) ReadLine(prompt string) (string, error) {
    	r.term.SetPrompt(prompt)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 30 18:10:36 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  10. guava/src/com/google/common/io/CharSink.java

          }
        }
      }
    
      /**
       * Writes all the text from the given {@link Readable} (such as a {@link Reader}) to this sink.
       * Does not close {@code readable} if it is {@code Closeable}.
       *
       * @return the number of characters written
       * @throws IOException if an I/O error occurs while reading from {@code readable} or writing to
       *     this sink
       */
      @CanIgnoreReturnValue
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed May 17 14:35:11 UTC 2023
    - 6.9K bytes
    - Viewed (0)
Back to top