Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for NewWriter (0.17 sec)

  1. 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.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Jan 27 00:22:03 GMT 2016
    - 2K bytes
    - Viewed (0)
  2. 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{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jul 05 21:45:49 GMT 2022
    - 6.8K bytes
    - Viewed (0)
  3. 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{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Dec 02 10:51:33 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  4. 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{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 6.7K bytes
    - Viewed (0)
  5. internal/config/cache/remote_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeCondCheck(b *testing.B) {
    	v := CondCheck{}
    	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 BenchmarkDecodeCondCheck(b *testing.B) {
    	v := CondCheck{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Nov 22 21:46:17 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  6. 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{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  7. cmd/tier-journal_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodejentry(b *testing.B) {
    	v := jentry{}
    	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 BenchmarkDecodejentry(b *testing.B) {
    	v := jentry{}
    Go
    - Registered: Sun Feb 25 19:28:16 GMT 2024
    - Last Modified: Thu Jun 03 21:26:51 GMT 2021
    - 4.3K bytes
    - Viewed (0)
  8. internal/dsync/lock-args_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeLockArgs(b *testing.B) {
    	v := LockArgs{}
    	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 BenchmarkDecodeLockArgs(b *testing.B) {
    	v := LockArgs{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 4.4K bytes
    - Viewed (0)
  9. 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)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Jan 13 18:06:33 GMT 2022
    - 2.2K bytes
    - Viewed (0)
  10. 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)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 4.9K bytes
    - Viewed (0)
Back to top