- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 38 for newWriter (0.26 seconds)
-
src/archive/tar/fuzz_test.go
// license that can be found in the LICENSE file. package tar import ( "bytes" "io" "testing" ) func FuzzReader(f *testing.F) { b := bytes.NewBuffer(nil) w := NewWriter(b)
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Thu Jan 13 18:06:33 GMT 2022 - 2.2K bytes - Click Count (0) -
src/archive/zip/fuzz_test.go
continue } } // If we were unable to read anything out of the archive don't // bother trying to roundtrip it. if len(files) == 0 { return } w := NewWriter(io.Discard) for _, f := range files { ww, err := w.CreateHeader(f.header) if err != nil { t.Fatalf("unable to write previously parsed header: %s", err) } if _, err := ww.Write(f.content); err != nil {
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Thu Jan 13 18:06:33 GMT 2022 - 1.7K bytes - Click Count (0) -
src/archive/zip/example_test.go
// Create a buffer to write our archive to. buf := new(bytes.Buffer) // Create a new zip archive. w := zip.NewWriter(buf) // Register a custom Deflate compressor. w.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) { return flate.NewWriter(out, flate.BestCompression) }) // Proceed to add files to w.
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Wed Jan 27 00:22:03 GMT 2016 - 2K bytes - Click Count (0) -
cmd/batch-handlers_gen_test.go
if err != nil { t.Error(err) } } func BenchmarkEncodeBatchJobPrefix(b *testing.B) { v := BatchJobPrefix{} var buf bytes.Buffer msgp.Encode(&buf, &v) b.SetBytes(int64(buf.Len())) en := msgp.NewWriter(msgp.Nowhere) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { v.EncodeMsg(en) } en.Flush() } func BenchmarkDecodeBatchJobPrefix(b *testing.B) { v := BatchJobPrefix{}Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 6.7K bytes - Click Count (0) -
cmd/local-locker_gen_test.go
if err != nil { t.Error(err) } } func BenchmarkEncodelocalLockMap(b *testing.B) { v := localLockMap{} var buf bytes.Buffer msgp.Encode(&buf, &v) b.SetBytes(int64(buf.Len())) en := msgp.NewWriter(msgp.Nowhere) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { v.EncodeMsg(en) } en.Flush() } func BenchmarkDecodelocalLockMap(b *testing.B) { v := localLockMap{}Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 6.7K bytes - Click Count (0) -
src/bufio/example_test.go
import ( "bufio" "bytes" "fmt" "os" "strconv" "strings" ) func ExampleWriter() { w := bufio.NewWriter(os.Stdout) fmt.Fprint(w, "Hello, ") fmt.Fprint(w, "world!") w.Flush() // Don't forget to flush! // Output: Hello, world! } func ExampleWriter_AvailableBuffer() { w := bufio.NewWriter(os.Stdout) for _, i := range []int64{1, 2, 3, 4} { b := w.AvailableBuffer() b = strconv.AppendInt(b, i, 10)
Created: Tue Apr 07 11:13:11 GMT 2026 - Last Modified: Fri Nov 01 21:52:12 GMT 2024 - 5.5K bytes - Click Count (0) -
cmd/storage-rest-common_gen_test.go
if err != nil { t.Error(err) } } func BenchmarkEncodensScannerOptions(b *testing.B) { v := nsScannerOptions{} var buf bytes.Buffer msgp.Encode(&buf, &v) b.SetBytes(int64(buf.Len())) en := msgp.NewWriter(msgp.Nowhere) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { v.EncodeMsg(en) } en.Flush() } func BenchmarkDecodensScannerOptions(b *testing.B) { v := nsScannerOptions{}Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 4.6K bytes - Click Count (0) -
cmd/batch-expire_gen_test.go
if err != nil { t.Error(err) } } func BenchmarkEncodeBatchJobExpire(b *testing.B) { v := BatchJobExpire{} var buf bytes.Buffer msgp.Encode(&buf, &v) b.SetBytes(int64(buf.Len())) en := msgp.NewWriter(msgp.Nowhere) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { v.EncodeMsg(en) } en.Flush() } func BenchmarkDecodeBatchJobExpire(b *testing.B) { v := BatchJobExpire{}Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 6.9K bytes - Click Count (0) -
cmd/last-minute_gen_test.go
if err != nil { t.Error(err) } } func BenchmarkEncodeAccElem(b *testing.B) { v := AccElem{} var buf bytes.Buffer msgp.Encode(&buf, &v) b.SetBytes(int64(buf.Len())) en := msgp.NewWriter(msgp.Nowhere) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { v.EncodeMsg(en) } en.Flush() } func BenchmarkDecodeAccElem(b *testing.B) { v := AccElem{}Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 6.8K bytes - Click Count (0) -
cmd/tier-last-day-stats_gen_test.go
if err != nil { t.Error(err) } } func BenchmarkEncodeDailyAllTierStats(b *testing.B) { v := DailyAllTierStats{} var buf bytes.Buffer msgp.Encode(&buf, &v) b.SetBytes(int64(buf.Len())) en := msgp.NewWriter(msgp.Nowhere) b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { v.EncodeMsg(en) } en.Flush() } func BenchmarkDecodeDailyAllTierStats(b *testing.B) { v := DailyAllTierStats{}Created: Sun Apr 05 19:28:12 GMT 2026 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 4.6K bytes - Click Count (0)