Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for writeBytes (0.22 sec)

  1. src/bufio/bufio_test.go

    	}
    }
    
    type readFromWriter struct {
    	buf           []byte
    	writeBytes    int
    	readFromBytes int
    }
    
    func (w *readFromWriter) Write(p []byte) (int, error) {
    	w.buf = append(w.buf, p...)
    	w.writeBytes += len(p)
    	return len(p), nil
    }
    
    func (w *readFromWriter) ReadFrom(r io.Reader) (int64, error) {
    	b, err := io.ReadAll(r)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
  2. src/bytes/buffer_test.go

    		n, err := buf.Write(testBytes[0:1])
    		if want := 1; err != nil || n != want {
    			t.Errorf("Write: got (%d, %v), want (%d, %v)", n, err, want, nil)
    		}
    		check(t, "TestBasicOperations (4)", &buf, "a")
    
    		buf.WriteByte(testString[1])
    		check(t, "TestBasicOperations (5)", &buf, "ab")
    
    		n, err = buf.Write(testBytes[2:26])
    		if want := 24; err != nil || n != want {
    			t.Errorf("Write: got (%d, %v), want (%d, %v)", n, err, want, nil)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  3. src/bytes/buffer.go

    	}
    	// Buffer is now empty; reset.
    	b.Reset()
    	return n, nil
    }
    
    // WriteByte appends the byte c to the buffer, growing the buffer as needed.
    // The returned error is always nil, but is included to match [bufio.Writer]'s
    // WriteByte. If the buffer becomes too large, WriteByte will panic with
    // [ErrTooLarge].
    func (b *Buffer) WriteByte(c byte) error {
    	b.lastRead = opInvalid
    	m, ok := b.tryGrowByReslice(1)
    	if !ok {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  4. api/go1.14.txt

    pkg hash/maphash, method (*Hash) Sum([]uint8) []uint8
    pkg hash/maphash, method (*Hash) Sum64() uint64
    pkg hash/maphash, method (*Hash) Write([]uint8) (int, error)
    pkg hash/maphash, method (*Hash) WriteByte(uint8) error
    pkg hash/maphash, method (*Hash) WriteString(string) (int, error)
    pkg hash/maphash, type Hash struct
    pkg hash/maphash, type Seed struct
    pkg log, const Lmsgprefix = 64
    pkg log, const Lmsgprefix ideal-int
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Fri Feb 17 20:31:46 GMT 2023
    - 508.9K bytes
    - Viewed (0)
  5. api/go1.txt

    pkg bufio, method (*Writer) Available() int
    pkg bufio, method (*Writer) Buffered() int
    pkg bufio, method (*Writer) Flush() error
    pkg bufio, method (*Writer) Write([]uint8) (int, error)
    pkg bufio, method (*Writer) WriteByte(uint8) error
    pkg bufio, method (*Writer) WriteRune(int32) (int, error)
    pkg bufio, method (*Writer) WriteString(string) (int, error)
    pkg bufio, method (ReadWriter) Available() int
    pkg bufio, method (ReadWriter) Flush() error
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Wed Aug 14 18:58:28 GMT 2013
    - 1.7M bytes
    - Viewed (1)
  6. api/go1.1.txt

    pkg image, const YCbCrSubsampleRatio444 = 0
    pkg image/draw, const Over = 0
    pkg image/draw, const Src = 1
    pkg image/jpeg, const DefaultQuality = 75
    pkg io, type ByteWriter interface { WriteByte }
    pkg io, type ByteWriter interface, WriteByte(uint8) error
    pkg io, var ErrNoProgress error
    pkg log, const Ldate = 1
    pkg log, const Llongfile = 8
    pkg log, const Lmicroseconds = 4
    pkg log, const Lshortfile = 16
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Thu Mar 31 20:37:15 GMT 2022
    - 2.6M bytes
    - Viewed (0)
  7. src/cmd/api/main_test.go

    			buf.WriteString(pkg.Name())
    			buf.WriteByte('.')
    		}
    		buf.WriteString(typ.Obj().Name())
    		if targs := typ.TypeArgs(); targs.Len() > 0 {
    			buf.WriteByte('[')
    			for i := 0; i < targs.Len(); i++ {
    				if i > 0 {
    					buf.WriteString(", ")
    				}
    				w.writeType(buf, targs.At(i))
    			}
    			buf.WriteByte(']')
    		}
    
    	case *types.TypeParam:
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Apr 09 20:48:51 GMT 2024
    - 31.4K bytes
    - Viewed (0)
  8. src/bufio/scan_test.go

    	}
    	for i := 0; i < n-1; i++ { // Stop early for \n.
    		c := 'a' + byte(lineNum+i)
    		if c == '\n' || c == '\r' { // Don't confuse us.
    			c = 'N'
    		}
    		buf.WriteByte(c)
    	}
    	if addNewline {
    		if doCR {
    			buf.WriteByte('\r')
    		}
    		buf.WriteByte('\n')
    	}
    }
    
    // Test the line splitter, including some carriage returns but no long lines.
    func TestScanLongLines(t *testing.T) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Sep 22 16:22:42 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  9. src/bufio/bufio.go

    		}
    		nn += n
    		p = p[n:]
    	}
    	if b.err != nil {
    		return nn, b.err
    	}
    	n := copy(b.buf[b.n:], p)
    	b.n += n
    	nn += n
    	return nn, nil
    }
    
    // WriteByte writes a single byte.
    func (b *Writer) WriteByte(c byte) error {
    	if b.err != nil {
    		return b.err
    	}
    	if b.Available() <= 0 && b.Flush() != nil {
    		return b.err
    	}
    	b.buf[b.n] = c
    	b.n++
    	return nil
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Oct 12 14:39:08 GMT 2023
    - 21.8K bytes
    - Viewed (0)
  10. api/go1.10.txt

    pkg strings, method (*Builder) Len() int
    pkg strings, method (*Builder) Reset()
    pkg strings, method (*Builder) String() string
    pkg strings, method (*Builder) Write([]uint8) (int, error)
    pkg strings, method (*Builder) WriteByte(uint8) error
    pkg strings, method (*Builder) WriteRune(int32) (int, error)
    pkg strings, method (*Builder) WriteString(string) (int, error)
    pkg strings, type Builder struct
    pkg syscall (freebsd-386), const SYS_UTIMENSAT = 547
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Tue Feb 06 05:00:01 GMT 2018
    - 30.1K bytes
    - Viewed (0)
Back to top