Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 208 for newReader (0.14 sec)

  1. cmd/xl-storage-format-v2_gen_test.go

    	}
    
    	vn := xlMetaDataDirDecoder{}
    	err := msgp.Decode(&buf, &vn)
    	if err != nil {
    		t.Error(err)
    	}
    
    	buf.Reset()
    	msgp.Encode(&buf, &v)
    	err = msgp.NewReader(&buf).Skip()
    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodexlMetaDataDirDecoder(b *testing.B) {
    	v := xlMetaDataDirDecoder{}
    	var buf bytes.Buffer
    	msgp.Encode(&buf, &v)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Nov 18 20:15:22 UTC 2021
    - 11.5K bytes
    - Viewed (0)
  2. src/bufio/scan_test.go

    	"\uFFFD", // correctly encoded RuneError
    	"abcdefgh",
    	"abc def\n\t\tgh    ",
    	"abc¼☹\x81\uFFFD日本語\x82abc",
    }
    
    func TestScanByte(t *testing.T) {
    	for n, test := range scanTests {
    		buf := strings.NewReader(test)
    		s := NewScanner(buf)
    		s.Split(ScanBytes)
    		var i int
    		for i = 0; s.Scan(); i++ {
    			if b := s.Bytes(); len(b) != 1 || b[0] != test[i] {
    				t.Errorf("#%d: %d: expected %q got %q", n, i, test, b)
    			}
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Sep 22 16:22:42 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  3. cmd/mrf.go

    	m.wg.Wait()
    	close(m.opCh)
    	atomic.StoreInt32(&m.closed, 1)
    
    	if len(m.opCh) > 0 {
    		healingLogEvent(context.Background(), "Saving MRF healing data (%d entries)", len(m.opCh))
    	}
    
    	newReader := func() io.ReadCloser {
    		r, w := io.Pipe()
    		go func() {
    			// Initialize MRF meta header.
    			var data [4]byte
    			binary.LittleEndian.PutUint16(data[0:2], healMRFMetaFormat)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Aug 13 22:26:05 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  4. cmd/dummy-data-generator_test.go

    	}
    	return true, ""
    }
    
    func TestCmpReaders(t *testing.T) {
    	{
    		r1 := bytes.NewReader([]byte("abc"))
    		r2 := bytes.NewReader([]byte("abc"))
    		ok, msg := cmpReaders(r1, r2)
    		if !(ok && msg == "") {
    			t.Fatalf("unexpected")
    		}
    	}
    
    	{
    		r1 := bytes.NewReader([]byte("abc"))
    		r2 := bytes.NewReader([]byte("abcd"))
    		ok, _ := cmpReaders(r1, r2)
    		if ok {
    			t.Fatalf("unexpected")
    		}
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jul 02 15:13:05 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  5. cmd/bucket-metadata.go

    	}
    
    	if len(b.LifecycleConfigXML) != 0 {
    		b.lifecycleConfig, err = lifecycle.ParseLifecycleConfig(bytes.NewReader(b.LifecycleConfigXML))
    		if err != nil {
    			return err
    		}
    	} else {
    		b.lifecycleConfig = nil
    	}
    
    	if len(b.EncryptionConfigXML) != 0 {
    		b.sseConfig, err = bucketsse.ParseBucketSSEConfig(bytes.NewReader(b.EncryptionConfigXML))
    		if err != nil {
    			return err
    		}
    	} else {
    		b.sseConfig = nil
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Aug 28 15:32:18 UTC 2024
    - 18.2K bytes
    - Viewed (0)
  6. cmd/background-newdisks-heal-ops_gen_test.go

    	}
    
    	vn := healingTracker{}
    	err := msgp.Decode(&buf, &vn)
    	if err != nil {
    		t.Error(err)
    	}
    
    	buf.Reset()
    	msgp.Encode(&buf, &v)
    	err = msgp.NewReader(&buf).Skip()
    	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()))
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Apr 23 18:58:53 UTC 2021
    - 2.3K bytes
    - Viewed (0)
  7. internal/config/crypto_test.go

    		ciphertext, err := Encrypt(KMS, bytes.NewReader(test.Data), test.Context)
    		if err != nil {
    			t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
    		}
    		data, err := io.ReadAll(ciphertext)
    		if err != nil {
    			t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
    		}
    
    		plaintext, err := Decrypt(KMS, bytes.NewReader(data), test.Context)
    		if err != nil {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  8. src/archive/tar/writer_test.go

    	if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.0")) {
    		t.Fatal("Expected at least one PAX header to be written.")
    	}
    	// Test that we can get a long name back out of the archive.
    	reader := NewReader(&buf)
    	hdr, err = reader.Next()
    	if err != nil {
    		t.Fatal(err)
    	}
    	if hdr.Name != longName {
    		t.Fatal("Couldn't recover long file name")
    	}
    }
    
    func TestPaxSymlink(t *testing.T) {
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Sep 23 14:32:33 UTC 2024
    - 39.4K bytes
    - Viewed (0)
  9. cmd/tier-last-day-stats_gen_test.go

    	}
    
    	vn := DailyAllTierStats{}
    	err := msgp.Decode(&buf, &vn)
    	if err != nil {
    		t.Error(err)
    	}
    
    	buf.Reset()
    	msgp.Encode(&buf, &v)
    	err = msgp.NewReader(&buf).Skip()
    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeDailyAllTierStats(b *testing.B) {
    	v := DailyAllTierStats{}
    	var buf bytes.Buffer
    	msgp.Encode(&buf, &v)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Feb 19 22:54:46 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  10. internal/bucket/bandwidth/monitor_gen_test.go

    	}
    
    	vn := BucketBandwidthReport{}
    	err := msgp.Decode(&buf, &vn)
    	if err != nil {
    		t.Error(err)
    	}
    
    	buf.Reset()
    	msgp.Encode(&buf, &v)
    	err = msgp.NewReader(&buf).Skip()
    	if err != nil {
    		t.Error(err)
    	}
    }
    
    func BenchmarkEncodeBucketBandwidthReport(b *testing.B) {
    	v := BucketBandwidthReport{}
    	var buf bytes.Buffer
    	msgp.Encode(&buf, &v)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Feb 19 22:54:46 UTC 2024
    - 4.5K bytes
    - Viewed (0)
Back to top