Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 93 for NewWriter (0.23 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 16 11:13:10 GMT 2024
    - Last Modified: Wed Jan 27 00:22:03 GMT 2016
    - 2K bytes
    - Viewed (0)
  2. src/archive/zip/writer_test.go

    	// write a zip file
    	archive := new(bytes.Buffer)
    	w := NewWriter(archive)
    
    	for i := range files {
    		f := &files[i]
    		f.crc32 = crc32.ChecksumIEEE(f.content)
    		size := uint64(len(f.content))
    		f.uncompressedSize = size
    		f.compressedSize = size
    
    		var compressedContent []byte
    		if f.method == Deflate {
    			var buf bytes.Buffer
    			w, err := flate.NewWriter(&buf, flate.BestSpeed)
    			if err != nil {
    Go
    - Registered: Tue Apr 16 11:13:10 GMT 2024
    - Last Modified: Fri Sep 15 19:04:06 GMT 2023
    - 14.1K bytes
    - Viewed (0)
  3. cmd/storage-datatypes_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeBaseOptions(b *testing.B) {
    	v := BaseOptions{}
    	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 BenchmarkDecodeBaseOptions(b *testing.B) {
    	v := BaseOptions{}
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Mon Apr 01 23:42:09 GMT 2024
    - 60.4K bytes
    - Viewed (0)
  4. cmd/bucket-replication-metrics_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeActiveWorkerStat(b *testing.B) {
    	v := ActiveWorkerStat{}
    	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 BenchmarkDecodeActiveWorkerStat(b *testing.B) {
    	v := ActiveWorkerStat{}
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Tue Feb 06 06:00:45 GMT 2024
    - 17.4K bytes
    - Viewed (0)
  5. cmd/data-usage-cache_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeallTierStats(b *testing.B) {
    	v := allTierStats{}
    	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 BenchmarkDecodeallTierStats(b *testing.B) {
    	v := allTierStats{}
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Sat Jan 13 07:51:08 GMT 2024
    - 28.1K bytes
    - Viewed (0)
  6. cmd/xl-storage-format-v1_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeChecksumInfo(b *testing.B) {
    	v := ChecksumInfo{}
    	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 BenchmarkDecodeChecksumInfo(b *testing.B) {
    	v := ChecksumInfo{}
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 13.2K bytes
    - Viewed (0)
  7. cmd/bucket-replication-utils_gen_test.go

    	}
    }
    
    func BenchmarkEncodeBucketReplicationResyncStatus(b *testing.B) {
    	v := BucketReplicationResyncStatus{}
    	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 BenchmarkDecodeBucketReplicationResyncStatus(b *testing.B) {
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Mon Aug 22 23:53:06 GMT 2022
    - 23K bytes
    - Viewed (0)
  8. internal/grid/msg_gen_test.go

    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeconnectReq(b *testing.B) {
    	v := connectReq{}
    	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 BenchmarkDecodeconnectReq(b *testing.B) {
    	v := connectReq{}
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 10.8K bytes
    - Viewed (0)
  9. cmd/erasure-server-pool-decom_gen_test.go

    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodePoolDecommissionInfo(b *testing.B) {
    	v := PoolDecommissionInfo{}
    	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 BenchmarkDecodePoolDecommissionInfo(b *testing.B) {
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Wed Jan 12 02:48:43 GMT 2022
    - 11K bytes
    - Viewed (0)
  10. cmd/xl-storage-format-v2_gen_test.go

    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodexlMetaDataDirDecoder(b *testing.B) {
    	v := xlMetaDataDirDecoder{}
    	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 BenchmarkDecodexlMetaDataDirDecoder(b *testing.B) {
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Thu Nov 18 20:15:22 GMT 2021
    - 11.5K bytes
    - Viewed (0)
Back to top