Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for WriteTo (0.21 sec)

  1. src/bufio/bufio_test.go

    	br := NewReader(strings.NewReader("example"))
    	br.WriteTo(io.Discard)
    	if err := br.UnreadRune(); err == nil {
    		t.Error("UnreadRune didn't fail after WriteTo")
    	}
    }
    
    func TestNoUnreadByteAfterWriteTo(t *testing.T) {
    	br := NewReader(strings.NewReader("example"))
    	br.WriteTo(io.Discard)
    	if err := br.UnreadByte(); err == nil {
    		t.Error("UnreadByte didn't fail after WriteTo")
    	}
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
  2. src/bytes/reader_test.go

    	{"ReadByte", func(r *Reader) { r.ReadByte() }},
    	{"UnreadRune", func(r *Reader) { r.UnreadRune() }},
    	{"Seek", func(r *Reader) { r.Seek(0, io.SeekCurrent) }},
    	{"WriteTo", func(r *Reader) { r.WriteTo(&Buffer{}) }},
    }
    
    func TestUnreadRuneError(t *testing.T) {
    	for _, tt := range UnreadRuneErrorTests {
    		reader := NewReader([]byte("0123456789"))
    		if _, _, err := reader.ReadRune(); err != nil {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Dec 13 18:45:54 GMT 2021
    - 8K bytes
    - Viewed (0)
  3. src/bytes/reader.go

    	}
    	r.i = abs
    	return abs, nil
    }
    
    // WriteTo implements the [io.WriterTo] interface.
    func (r *Reader) WriteTo(w io.Writer) (n int64, err error) {
    	r.prevRune = -1
    	if r.i >= int64(len(r.s)) {
    		return 0, nil
    	}
    	b := r.s[r.i:]
    	m, err := w.Write(b)
    	if m > len(b) {
    		panic("bytes.Reader.WriteTo: invalid Write count")
    	}
    	r.i += int64(m)
    	n = int64(m)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  4. src/bytes/buffer.go

    	copy(b2, b)
    	return b2[:len(b)]
    }
    
    // WriteTo writes data to w until the buffer is drained or an error occurs.
    // The return value n is the number of bytes written; it always fits into an
    // int, but it is int64 to match the io.WriterTo interface. Any error
    // encountered during the write is also returned.
    func (b *Buffer) WriteTo(w io.Writer) (n int64, err error) {
    	b.lastRead = opInvalid
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  5. src/archive/tar/reader_test.go

    				}
    			case testWriteTo:
    				f := &testFile{ops: tf.ops}
    				got, err := fr.WriteTo(f)
    				if _, ok := err.(testError); ok {
    					t.Errorf("test %d.%d, WriteTo(): %v", i, j, err)
    				} else if got != tf.wantCnt || err != tf.wantErr {
    					t.Errorf("test %d.%d, WriteTo() = (%d, %v), want (%d, %v)", i, j, got, err, tf.wantCnt, tf.wantErr)
    				}
    				if len(f.ops) > 0 {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Nov 21 21:14:38 GMT 2022
    - 47.1K bytes
    - Viewed (0)
  6. src/bytes/buffer_test.go

    }
    
    func TestWriteTo(t *testing.T) {
    	var buf Buffer
    	for i := 3; i < 30; i += 3 {
    		s := fillBytes(t, "TestWriteTo (1)", &buf, "", 5, testBytes[0:len(testBytes)/i])
    		var b Buffer
    		buf.WriteTo(&b)
    		empty(t, "TestWriteTo (2)", &b, s, make([]byte, len(testString)))
    	}
    }
    
    func TestWriteAppend(t *testing.T) {
    	var got Buffer
    	var want []byte
    	for i := 0; i < 1000; i++ {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 20 01:07:29 GMT 2023
    - 18.1K bytes
    - Viewed (0)
  7. api/go1.5.txt

    pkg go/types, method (*Scope) NumChildren() int
    pkg go/types, method (*Scope) Parent() *Scope
    pkg go/types, method (*Scope) Pos() token.Pos
    pkg go/types, method (*Scope) String() string
    pkg go/types, method (*Scope) WriteTo(io.Writer, int, bool)
    pkg go/types, method (*Selection) Index() []int
    pkg go/types, method (*Selection) Indirect() bool
    pkg go/types, method (*Selection) Kind() SelectionKind
    pkg go/types, method (*Selection) Obj() Object
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Jul 30 21:14:09 GMT 2015
    - 46.6K bytes
    - Viewed (0)
  8. api/go1.8.txt

    pkg net/http, var ErrServerClosed error
    pkg net/http, var NoBody noBody
    pkg net/mail, func ParseDate(string) (time.Time, error)
    pkg net, method (*Buffers) Read([]uint8) (int, error)
    pkg net, method (*Buffers) WriteTo(io.Writer) (int64, error)
    pkg net, method (*Resolver) LookupAddr(context.Context, string) ([]string, error)
    pkg net, method (*Resolver) LookupCNAME(context.Context, string) (string, error)
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Dec 21 05:25:57 GMT 2016
    - 16.3K bytes
    - Viewed (0)
  9. src/archive/tar/reader.go

    	if err != nil && err != io.EOF {
    		tr.err = err
    	}
    	return n, err
    }
    
    // writeTo writes the content of the current file to w.
    // The bytes written matches the number of remaining bytes in the current file.
    //
    // If the current file is sparse and w is an io.WriteSeeker,
    // then writeTo uses Seek to skip past holes defined in Header.SparseHoles,
    // assuming that skipped regions are filled with NULs.
    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)
  10. src/bufio/bufio.go

    		buf.Write(fb)
    	}
    	buf.Write(frag)
    	return buf.String(), err
    }
    
    // WriteTo implements io.WriterTo.
    // This may make multiple calls to the [Reader.Read] method of the underlying [Reader].
    // If the underlying reader supports the [Reader.WriteTo] method,
    // this calls the underlying [Reader.WriteTo] without buffering.
    func (b *Reader) WriteTo(w io.Writer) (n int64, err error) {
    	b.lastByte = -1
    	b.lastRuneSize = -1
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
Back to top