Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for PutVarint (0.59 sec)

  1. src/encoding/binary/varint.go

    // as generated by [PutVarint], to buf and returns the extended buffer.
    func AppendVarint(buf []byte, x int64) []byte {
    	ux := uint64(x) << 1
    	if x < 0 {
    		ux = ^ux
    	}
    	return AppendUvarint(buf, ux)
    }
    
    // PutVarint encodes an int64 into buf and returns the number of bytes written.
    // If the buffer is too small, PutVarint will panic.
    func PutVarint(buf []byte, x int64) int {
    	ux := uint64(x) << 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  2. src/index/suffixarray/suffixarray.go

    		ix.sa.int64 = make([]int64, len(data))
    		text_64(data, ix.sa.int64)
    	}
    	return ix
    }
    
    // writeInt writes an int x to w using buf to buffer the write.
    func writeInt(w io.Writer, buf []byte, x int) error {
    	binary.PutVarint(buf, int64(x))
    	_, err := w.Write(buf[0:binary.MaxVarintLen64])
    	return err
    }
    
    // readInt reads an int x from r using buf to buffer the read and returns x.
    func readInt(r io.Reader, buf []byte) (int64, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  3. src/encoding/binary/varint_test.go

    	testConstant(t, 16, MaxVarintLen16)
    	testConstant(t, 32, MaxVarintLen32)
    	testConstant(t, 64, MaxVarintLen64)
    }
    
    func testVarint(t *testing.T, x int64) {
    	buf := make([]byte, MaxVarintLen64)
    	n := PutVarint(buf, x)
    	y, m := Varint(buf[0:n])
    	if x != y {
    		t.Errorf("Varint(%d): got %d", x, y)
    	}
    	if n != m {
    		t.Errorf("Varint(%d): got n = %d; want %d", x, m, n)
    	}
    
    	buf2 := []byte("prefix")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 16 23:09:19 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  4. src/cmd/internal/obj/pcln.go

    		if started {
    			pcdelta := (p.Pc - pc) / int64(ctxt.Arch.MinLC)
    			n := binary.PutUvarint(buf, uint64(pcdelta))
    			dst = append(dst, buf[:n]...)
    			pc = p.Pc
    		}
    
    		delta := val - oldval
    		n := binary.PutVarint(buf, int64(delta))
    		dst = append(dst, buf[:n]...)
    		oldval = val
    		started = true
    		val = valfunc(ctxt, func_, val, p, 1, arg)
    	}
    
    	if started {
    		if dbg {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 31 20:45:15 UTC 2022
    - 11.8K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"LittleEndian", Var, 0},
    		{"MaxVarintLen16", Const, 0},
    		{"MaxVarintLen32", Const, 0},
    		{"MaxVarintLen64", Const, 0},
    		{"NativeEndian", Var, 21},
    		{"PutUvarint", Func, 0},
    		{"PutVarint", Func, 0},
    		{"Read", Func, 0},
    		{"ReadUvarint", Func, 0},
    		{"ReadVarint", Func, 0},
    		{"Size", Func, 0},
    		{"Uvarint", Func, 0},
    		{"Varint", Func, 0},
    		{"Write", Func, 0},
    	},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top