Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for newReader (0.05 sec)

  1. src/bufio/bufio_test.go

    		}
    	}
    	return string(b[0:nb])
    }
    
    func TestReaderSimple(t *testing.T) {
    	data := "hello world"
    	b := NewReader(strings.NewReader(data))
    	if s := readBytes(b); s != "hello world" {
    		t.Errorf("simple hello world test failed: got %q", s)
    	}
    
    	b = NewReader(newRot13Reader(strings.NewReader(data)))
    	if s := readBytes(b); s != "uryyb jbeyq" {
    		t.Errorf("rot13 hello world test failed: got %q", s)
    	}
    }
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Nov 01 21:52:12 UTC 2024
    - 51.6K bytes
    - Viewed (0)
  2. src/bufio/example_test.go

    func ExampleWriter_ReadFrom() {
    	var buf bytes.Buffer
    	writer := bufio.NewWriter(&buf)
    
    	data := "Hello, world!\nThis is a ReadFrom example."
    	reader := strings.NewReader(data)
    
    	n, err := writer.ReadFrom(reader)
    	if err != nil {
    		fmt.Println("ReadFrom Error:", err)
    		return
    	}
    
    	if err = writer.Flush(); err != nil {
    		fmt.Println("Flush Error:", err)
    		return
    	}
    
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Nov 01 21:52:12 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/CharSinkTest.java

          assertThrows(IOException.class, () -> failSource.copyTo(okSink));
          // ensure writer was closed IF it was opened (depends on implementation whether or not it's
          // opened at all if source.newReader() throws).
          assertTrue(
              "stream not closed when copying from source with option: " + option,
              !okSink.wasStreamOpened() || okSink.wasStreamClosed());
        }
      }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 31 14:20:11 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  4. cmd/warm-backend.go

    // to perform all operations defined in the WarmBackend interface.
    func checkWarmBackend(ctx context.Context, w WarmBackend) error {
    	remoteVersionID, err := w.Put(ctx, probeObject, strings.NewReader("MinIO"), 5)
    	if err != nil {
    		if _, ok := err.(BackendDown); ok {
    			return err
    		}
    		return tierPermErr{
    			Op:  tierPut,
    			Err: err,
    		}
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Oct 31 22:10:24 UTC 2024
    - 4K bytes
    - Viewed (0)
  5. cmd/erasure-healing-common.go

    		}
    
    		// Always check data, if we got it.
    		if (len(meta.Data) > 0 || meta.Size == 0) && len(meta.Parts) > 0 {
    			checksumInfo := meta.Erasure.GetChecksumInfo(meta.Parts[0].Number)
    			verifyErr := bitrotVerify(bytes.NewReader(meta.Data),
    				int64(len(meta.Data)),
    				meta.Erasure.ShardFileSize(meta.Size),
    				checksumInfo.Algorithm,
    				checksumInfo.Hash, meta.Erasure.ShardSize())
    			dataErrsByPart[0][i] = convPartErrToInt(verifyErr)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Oct 31 22:10:24 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  6. cmd/iam.go

    	if ptok && spok && pt == embeddedPolicyType {
    		policyBytes, err := base64.StdEncoding.DecodeString(sp)
    		if err != nil {
    			return UserIdentity{}, nil, err
    		}
    		embeddedPolicy, err = policy.ParseConfig(bytes.NewReader(policyBytes))
    		if err != nil {
    			return UserIdentity{}, nil, err
    		}
    	}
    
    	return sa, embeddedPolicy, nil
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Oct 29 16:01:48 UTC 2024
    - 74.6K bytes
    - Viewed (0)
  7. cmd/erasure-object.go

    			return &GetObjectReader{
    				ObjInfo: objInfo,
    			}, err
    		}
    
    		// Zero byte objects don't even need to further initialize pipes etc.
    		return NewGetObjectReaderFromReader(bytes.NewReader(nil), objInfo, opts)
    	}
    
    	if objInfo.IsRemote() {
    		gr, err := getTransitionedObjectReader(ctx, bucket, object, rs, h, objInfo, opts)
    		if err != nil {
    			return nil, err
    		}
    		unlockOnDefer = false
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Oct 31 22:10:24 UTC 2024
    - 78.8K bytes
    - Viewed (0)
Back to top