Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 94 for newWriter (0.18 sec)

  1. 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)
  2. src/archive/zip/zip_test.go

    	"sort"
    	"strings"
    	"testing"
    	"time"
    )
    
    func TestOver65kFiles(t *testing.T) {
    	if testing.Short() && testenv.Builder() == "" {
    		t.Skip("skipping in short mode")
    	}
    	buf := new(strings.Builder)
    	w := NewWriter(buf)
    	const nFiles = (1 << 16) + 42
    	for i := 0; i < nFiles; i++ {
    		_, err := w.CreateHeader(&FileHeader{
    			Name:   fmt.Sprintf("%d.dat", i),
    			Method: Store, // Deflate is too slow when it is compiled with -race flag
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  3. cmd/metacache-set_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodelistPathOptions(b *testing.B) {
    	v := listPathOptions{}
    	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 BenchmarkDecodelistPathOptions(b *testing.B) {
    	v := listPathOptions{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  4. cmd/metacache_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodemetacache(b *testing.B) {
    	v := metacache{}
    	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 BenchmarkDecodemetacache(b *testing.B) {
    	v := metacache{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 2.3K bytes
    - Viewed (0)
  5. cmd/tier_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeTierConfigMgr(b *testing.B) {
    	v := TierConfigMgr{}
    	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 BenchmarkDecodeTierConfigMgr(b *testing.B) {
    	v := TierConfigMgr{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 2.3K bytes
    - Viewed (0)
  6. internal/bucket/bandwidth/monitor_gen_test.go

    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeBucketBandwidthReport(b *testing.B) {
    	v := BucketBandwidthReport{}
    	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 BenchmarkDecodeBucketBandwidthReport(b *testing.B) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  7. 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{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 4.6K bytes
    - Viewed (0)
  8. android/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 May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  9. cmd/background-newdisks-heal-ops_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodehealingTracker(b *testing.B) {
    	v := healingTracker{}
    	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 BenchmarkDecodehealingTracker(b *testing.B) {
    	v := healingTracker{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 2.3K bytes
    - Viewed (0)
  10. cmd/metacache-walk_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeWalkDirOptions(b *testing.B) {
    	v := WalkDirOptions{}
    	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 BenchmarkDecodeWalkDirOptions(b *testing.B) {
    	v := WalkDirOptions{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 2.3K bytes
    - Viewed (0)
Back to top