- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 131 for buf1 (0.04 sec)
-
android/guava/src/com/google/common/io/ByteSource.java
checkNotNull(other); byte[] buf1 = createBuffer(); byte[] buf2 = createBuffer(); Closer closer = Closer.create(); try { InputStream in1 = closer.register(openStream()); InputStream in2 = closer.register(other.openStream()); while (true) { int read1 = ByteStreams.read(in1, buf1, 0, buf1.length); int read2 = ByteStreams.read(in2, buf2, 0, buf2.length);
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 26.2K bytes - Viewed (0) -
src/bufio/bufio_test.go
} func TestWriterReset(t *testing.T) { var buf1, buf2, buf3, buf4, buf5 strings.Builder w := NewWriter(&buf1) w.WriteString("foo") w.Reset(&buf2) // and not flushed w.WriteString("bar") w.Flush() if buf1.String() != "" { t.Errorf("buf1 = %q; want empty", buf1.String()) } if buf2.String() != "bar" { t.Errorf("buf2 = %q; want bar", buf2.String()) }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Fri Nov 01 21:52:12 UTC 2024 - 51.6K bytes - Viewed (0) -
src/bytes/bytes_test.go
for i := 0; i < b.N; i++ { j := IndexRune(buf, needle) if j != n { b.Fatal("bad index", j) } } for i := range buf { buf[i] = '\x00' } } } func BenchmarkEqual(b *testing.B) { b.Run("0", func(b *testing.B) { var buf [4]byte buf1 := buf[0:0] buf2 := buf[1:1] for i := 0; i < b.N; i++ { eq := Equal(buf1, buf2) if !eq { b.Fatal("bad equal") }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Mon Aug 19 19:09:04 UTC 2024 - 61.2K bytes - Viewed (0) -
src/bytes/example_test.go
var buf bytes.Buffer for i := 0; i < 4; i++ { b := buf.AvailableBuffer() b = strconv.AppendInt(b, int64(i), 10) b = append(b, ' ') buf.Write(b) } os.Stdout.Write(buf.Bytes()) // Output: 0 1 2 3 } func ExampleBuffer_Cap() { buf1 := bytes.NewBuffer(make([]byte, 10)) buf2 := bytes.NewBuffer(make([]byte, 0, 10)) fmt.Println(buf1.Cap()) fmt.Println(buf2.Cap()) // Output: // 10 // 10 }
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Wed Aug 07 17:22:36 UTC 2024 - 14.9K bytes - Viewed (0) -
internal/jwt/parser.go
} headerDec := buf[:n] buf = buf[n:] alg, _, _, err := jsonparser.Get(headerDec, "alg") if err != nil { return nil, &jwtgo.ValidationError{Inner: err, Errors: jwtgo.ValidationErrorMalformed} } n, err = base64DecodeBytes(token[i+1:j], buf) if err != nil { return nil, &jwtgo.ValidationError{Inner: err, Errors: jwtgo.ValidationErrorMalformed} } if err = claims.UnmarshalJSON(buf[:n]); err != nil {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Tue Sep 17 16:45:46 UTC 2024 - 14.1K bytes - Viewed (0) -
cmd/erasure-decode.go
startBlock := int64(0) endBlock := totalLength / e.blockSize if totalLength%e.blockSize != 0 { endBlock++ } var bufs [][]byte for block := startBlock; block < endBlock; block++ { var err error bufs, err = reader.Read(bufs) if len(bufs) > 0 { if errors.Is(err, errFileNotFound) || errors.Is(err, errFileCorrupt) { if derr == nil { derr = err } }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Aug 29 01:40:52 UTC 2024 - 9.5K bytes - Viewed (0) -
src/archive/zip/writer_test.go
r, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len())) if err != nil { t.Fatal(err) } for i, wt := range writeTests { testReadFile(t, r.File[i], &wt) } } func TestWriterFlush(t *testing.T) { var buf bytes.Buffer w := NewWriter(struct{ io.Writer }{&buf}) _, err := w.Create("foo") if err != nil { t.Fatal(err) } if buf.Len() > 0 {
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Mon Sep 23 14:32:33 UTC 2024 - 14.4K bytes - Viewed (0) -
guava/src/com/google/common/io/ByteStreams.java
byte[] buf = new byte[min(bufSize, MAX_ARRAY_LEN - totalLen)]; bufs.add(buf); int off = 0; while (off < buf.length) { // always OK to fill buf; its size plus the rest of bufs is never more than MAX_ARRAY_LEN int r = in.read(buf, off, buf.length - off); if (r == -1) { return combineBuffers(bufs, totalLen); } off += r;
Registered: Fri Nov 01 12:43:10 UTC 2024 - Last Modified: Sat Oct 19 00:26:48 UTC 2024 - 29.7K bytes - Viewed (0) -
internal/ioutil/ioutil.go
} var written int64 for { buf := alignedBuf if totalSize > 0 { remaining := totalSize - written if remaining < int64(len(buf)) { buf = buf[:remaining] } } nr, err := io.ReadFull(r, buf) eof := errors.Is(err, io.EOF) || errors.Is(err, io.ErrUnexpectedEOF) if err != nil && !eof { return written, err } buf = buf[:nr] var ( n int un int
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jul 26 12:55:01 UTC 2024 - 10.9K bytes - Viewed (0) -
internal/ioutil/ioutil_test.go
t.Errorf("Error creating tmp file: %v", err) } defer f.Close() defer os.Remove(f.Name()) r := strings.NewReader("hello world") bufp := ODirectPoolSmall.Get().(*[]byte) defer ODirectPoolSmall.Put(bufp) written, err := CopyAligned(f, io.LimitReader(r, 5), *bufp, r.Size(), f) if !errors.Is(err, io.ErrUnexpectedEOF) { t.Errorf("Expected io.ErrUnexpectedEOF, but got %v", err) } if written != 5 {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed May 22 23:07:14 UTC 2024 - 5.5K bytes - Viewed (0)