Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 47 for buffer (0.25 sec)

  1. src/cmd/cgo/gcc.go

    	}
    	p.rewriteRef(f)
    }
    
    // loadDefines coerces gcc into spitting out the #defines in use
    // in the file f and saves relevant renamings in f.Name[name].Define.
    func (p *Package) loadDefines(f *File) {
    	var b bytes.Buffer
    	b.WriteString(builtinProlog)
    	b.WriteString(f.Preamble)
    	stdout := p.gccDefines(b.Bytes())
    
    	for _, line := range strings.Split(stdout, "\n") {
    		if len(line) < 9 || line[0:7] != "#define" {
    			continue
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Nov 02 16:43:23 GMT 2023
    - 97K bytes
    - Viewed (0)
  2. src/cmd/api/main_test.go

    		}
    		w.writeType(buf, typ)
    	}
    	buf.WriteByte(')')
    }
    
    func (w *Walker) typeString(typ types.Type) string {
    	var buf bytes.Buffer
    	w.writeType(&buf, typ)
    	return buf.String()
    }
    
    func (w *Walker) signatureString(sig *types.Signature) string {
    	var buf bytes.Buffer
    	w.writeSignature(&buf, sig)
    	return buf.String()
    }
    
    func (w *Walker) emitObj(obj types.Object) {
    	switch obj := obj.(type) {
    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)
  3. src/archive/tar/writer.go

    	w    io.Writer
    	pad  int64      // Amount of padding to write after current file entry
    	curr fileWriter // Writer for current file entry
    	hdr  Header     // Shallow copy of Header that is safe for mutations
    	blk  block      // Buffer to use as temporary local storage
    
    	// err is a persistent error.
    	// It is only the responsibility of every exported method of Writer to
    	// ensure that this error is sticky.
    	err error
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
  4. src/archive/tar/reader_test.go

    			t.Errorf("test %d, canary byte unexpectedly consumed", i)
    		}
    	}
    }
    
    // testNonEmptyReader wraps an io.Reader and ensures that
    // Read is never called with an empty buffer.
    type testNonEmptyReader struct{ io.Reader }
    
    func (r testNonEmptyReader) Read(b []byte) (int, error) {
    	if len(b) == 0 {
    		return 0, errors.New("unexpected empty Read call")
    	}
    	return r.Reader.Read(b)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Nov 21 21:14:38 GMT 2022
    - 47.1K bytes
    - Viewed (0)
  5. src/archive/zip/example_test.go

    package zip_test
    
    import (
    	"archive/zip"
    	"bytes"
    	"compress/flate"
    	"fmt"
    	"io"
    	"log"
    	"os"
    )
    
    func ExampleWriter() {
    	// Create a buffer to write our archive to.
    	buf := new(bytes.Buffer)
    
    	// Create a new zip archive.
    	w := zip.NewWriter(buf)
    
    	// Add some files to the archive.
    	var files = []struct {
    		Name, Body string
    	}{
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 27 00:22:03 GMT 2016
    - 2K bytes
    - Viewed (0)
  6. api/go1.6.txt

    pkg archive/zip, method (*Reader) RegisterDecompressor(uint16, Decompressor)
    pkg archive/zip, method (*Writer) RegisterCompressor(uint16, Compressor)
    pkg bufio, method (*Scanner) Buffer([]uint8, int)
    pkg bufio, var ErrFinalToken error
    pkg crypto/tls, const TLS_RSA_WITH_AES_128_GCM_SHA256 = 156
    pkg crypto/tls, const TLS_RSA_WITH_AES_128_GCM_SHA256 uint16
    pkg crypto/tls, const TLS_RSA_WITH_AES_256_GCM_SHA384 = 157
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Wed Jan 13 23:40:13 GMT 2016
    - 12.9K bytes
    - Viewed (0)
  7. src/bytes/compare_test.go

    	{nil, []byte("a"), -1},
    }
    
    func TestCompare(t *testing.T) {
    	for _, tt := range compareTests {
    		numShifts := 16
    		buffer := make([]byte, len(tt.b)+numShifts)
    		// vary the input alignment of tt.b
    		for offset := 0; offset <= numShifts; offset++ {
    			shiftedB := buffer[offset : len(tt.b)+offset]
    			copy(shiftedB, tt.b)
    			cmp := Compare(tt.a, shiftedB)
    			if cmp != tt.i {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Jul 13 23:11:42 GMT 2023
    - 6.8K bytes
    - Viewed (0)
  8. src/bytes/bytes_test.go

    		if err := recover(); err == nil {
    			t.Fatal("Grow(-1) should have panicked")
    		}
    	}()
    	var b Buffer
    	b.Grow(-1)
    }
    
    func TestBufferTruncateNegative(t *testing.T) {
    	defer func() {
    		if err := recover(); err == nil {
    			t.Fatal("Truncate(-1) should have panicked")
    		}
    	}()
    	var b Buffer
    	b.Truncate(-1)
    }
    
    func TestBufferTruncateOutOfRange(t *testing.T) {
    	defer func() {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 24 16:07:25 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  9. src/archive/tar/tar_test.go

    		for _, v := range vectors {
    			var buf bytes.Buffer
    			var r bytes.Reader
    
    			// Write the archive to a byte buffer.
    			tw := NewWriter(&buf)
    			for _, file := range v.files {
    				tw.WriteHeader(file.hdr)
    				tw.Write(file.body)
    			}
    			tw.Close()
    			b.Run(v.label, func(b *testing.B) {
    				b.ReportAllocs()
    				// Read from the byte buffer.
    				for i := 0; i < b.N; i++ {
    					r.Reset(buf.Bytes())
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24K bytes
    - Viewed (0)
  10. src/archive/tar/reader.go

    type Reader struct {
    	r    io.Reader
    	pad  int64      // Amount of padding (ignored) after current file entry
    	curr fileReader // Reader for current file entry
    	blk  block      // Buffer to use as temporary local storage
    
    	// err is a persistent error.
    	// It is only the responsibility of every exported method of Reader to
    	// ensure that this error is sticky.
    	err error
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
Back to top