Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 64 for Bytes (0.18 sec)

  1. src/bytes/bytes.go

    // license that can be found in the LICENSE file.
    
    // Package bytes implements functions for the manipulation of byte slices.
    // It is analogous to the facilities of the [strings] package.
    package bytes
    
    import (
    	"internal/bytealg"
    	"unicode"
    	"unicode/utf8"
    )
    
    // Equal reports whether a and b
    // are the same length and contain the same bytes.
    // A nil argument is equivalent to an empty slice.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  2. src/bytes/bytes_test.go

    // Copyright 2009 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package bytes_test
    
    import (
    	. "bytes"
    	"fmt"
    	"internal/testenv"
    	"math"
    	"math/rand"
    	"reflect"
    	"strings"
    	"testing"
    	"unicode"
    	"unicode/utf8"
    	"unsafe"
    )
    
    func eq(a, b []string) bool {
    	if len(a) != len(b) {
    		return false
    	}
    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)
  3. src/bytes/reader.go

    	prevRune int   // index of previous rune; or < 0
    }
    
    // Len returns the number of bytes of the unread portion of the
    // slice.
    func (r *Reader) Len() int {
    	if r.i >= int64(len(r.s)) {
    		return 0
    	}
    	return int(int64(len(r.s)) - r.i)
    }
    
    // Size returns the original length of the underlying byte slice.
    // Size is the number of bytes available for reading via [Reader.ReadAt].
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  4. src/archive/zip/zip_test.go

    // suffixSaver is an io.Writer & io.ReaderAt that remembers the last 0
    // to 'keep' bytes of data written to it. Call Suffix to get the
    // suffix bytes.
    type suffixSaver struct {
    	keep  int
    	buf   []byte
    	start int
    	size  int64
    }
    
    func (ss *suffixSaver) Size() int64 { return ss.size }
    
    var errDiscardedBytes = errors.New("ReadAt of discarded bytes")
    
    func (ss *suffixSaver) ReadAt(p []byte, off int64) (n int, err error) {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  5. misc/ios/detect.go

    	out, err := exec.Command("/usr/libexec/PlistBuddy", "-c", "Print "+path, fname).CombinedOutput()
    	if err != nil {
    		return nil, err
    	}
    	return bytes.TrimSpace(out), nil
    }
    
    func getLines(cmd *exec.Cmd) [][]byte {
    	out := output(cmd)
    	lines := bytes.Split(out, []byte("\n"))
    	// Skip the empty line at the end.
    	if len(lines[len(lines)-1]) == 0 {
    		lines = lines[:len(lines)-1]
    	}
    	return lines
    }
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Oct 19 23:33:30 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  6. src/bytes/reader_test.go

    // Copyright 2012 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package bytes_test
    
    import (
    	. "bytes"
    	"fmt"
    	"io"
    	"sync"
    	"testing"
    )
    
    func TestReader(t *testing.T) {
    	r := NewReader([]byte("0123456789"))
    	tests := []struct {
    		off     int64
    		seek    int
    		n       int
    		want    string
    		wantpos int64
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Dec 13 18:45:54 GMT 2021
    - 8K bytes
    - Viewed (0)
  7. src/archive/tar/example_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package tar_test
    
    import (
    	"archive/tar"
    	"bytes"
    	"fmt"
    	"io"
    	"log"
    	"os"
    )
    
    func Example_minimal() {
    	// Create and add some files to the archive.
    	var buf bytes.Buffer
    	tw := tar.NewWriter(&buf)
    	var files = []struct {
    		Name, Body string
    	}{
    		{"readme.txt", "This archive contains some text files."},
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Nov 16 16:54:08 GMT 2017
    - 1.4K bytes
    - Viewed (0)
  8. src/bytes/export_test.go

    // Copyright 2009 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package bytes
    
    // Export func for testing
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Apr 24 00:56:36 GMT 2019
    - 244 bytes
    - Viewed (0)
  9. src/archive/tar/writer.go

    	}
    	if nb := tw.curr.logicalRemaining(); nb > 0 {
    		return fmt.Errorf("archive/tar: missed writing %d bytes", nb)
    	}
    	if _, tw.err = tw.w.Write(zeroBlock[:tw.pad]); tw.err != nil {
    		return tw.err
    	}
    	tw.pad = 0
    	return nil
    }
    
    // WriteHeader writes hdr and prepares to accept the file's contents.
    // The Header.Size determines how many bytes can be written for the next file.
    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)
  10. src/builtin/builtin.go

    func append(slice []Type, elems ...Type) []Type
    
    // The copy built-in function copies elements from a source slice into a
    // destination slice. (As a special case, it also will copy bytes from a
    // string to a slice of bytes.) The source and destination may overlap. Copy
    // returns the number of elements copied, which will be the minimum of
    // len(src) and len(dst).
    func copy(dst, src []Type) int
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 12.7K bytes
    - Viewed (0)
Back to top