Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 94 for NewWriter (0.2 sec)

  1. 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)
  2. 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)
  3. guava-tests/test/com/google/common/io/FilesTest.java

      public void testNewWriter() throws IOException {
        File temp = createTempFile();
        assertThrows(NullPointerException.class, () -> Files.newWriter(temp, null));
    
        assertThrows(NullPointerException.class, () -> Files.newWriter(null, Charsets.UTF_8));
    
        BufferedWriter w = Files.newWriter(temp, Charsets.UTF_8);
        try {
          w.write(I18N);
        } finally {
          w.close();
        }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  4. 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)
  5. cmd/batch-handlers_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeBatchJobRequest(b *testing.B) {
    	v := BatchJobRequest{}
    	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 BenchmarkDecodeBatchJobRequest(b *testing.B) {
    	v := BatchJobRequest{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Aug 29 18:27:23 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. cmd/site-replication-metrics_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeRStat(b *testing.B) {
    	v := RStat{}
    	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 BenchmarkDecodeRStat(b *testing.B) {
    	v := RStat{}
    	var buf bytes.Buffer
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Aug 30 08:00:59 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  9. 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 {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Jan 13 18:06:33 GMT 2022
    - 1.7K 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