Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for NewBufferString (0.19 sec)

  1. cmd/object_api_suite_test.go

    	{
    		_, err = obj.PutObject(context.Background(), "bucket", "newPrefix", mustGetPutObjReader(t, bytes.NewBufferString(uploadContent), int64(len(uploadContent)), "", ""), opts)
    		if err != nil {
    			t.Fatalf("%s: <ERROR> %s", instanceType, err)
    		}
    		_, err = obj.PutObject(context.Background(), "bucket", "newPrefix2", mustGetPutObjReader(t, bytes.NewBufferString(uploadContent), int64(len(uploadContent)), "", ""), opts)
    		if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 32.3K bytes
    - Viewed (0)
  2. cmd/object-api-getobjectinfo_test.go

    	if err != nil {
    		t.Fatalf("%s : %s", instanceType, err.Error())
    	}
    
    	// Put an empty directory
    	_, err = obj.PutObject(context.Background(), "test-getobjectinfo", "Asia/empty-dir/", mustGetPutObjReader(t, bytes.NewBufferString(""), int64(len("")), "", ""), opts)
    	if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Dec 23 15:46:00 GMT 2022
    - 5.6K bytes
    - Viewed (0)
  3. src/bytes/buffer_test.go

    	})
    	if n > 0 {
    		t.Errorf("allocations occurred while shallow copying")
    	}
    	check(t, "NewBuffer", &buf, testString)
    }
    
    func TestNewBufferString(t *testing.T) {
    	buf := NewBufferString(testString)
    	check(t, "NewBufferString", buf, testString)
    }
    
    // Empty buf through repeated reads into fub.
    // The initial contents of buf corresponds to the string s.
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Apr 26 13:31:36 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  4. src/bytes/buffer.go

    func NewBuffer(buf []byte) *Buffer { return &Buffer{buf: buf} }
    
    // NewBufferString creates and initializes a new [Buffer] using string s as its
    // initial contents. It is intended to prepare a buffer to read an existing
    // string.
    //
    // In most cases, new([Buffer]) (or just declaring a [Buffer] variable) is
    // sufficient to initialize a [Buffer].
    func NewBufferString(s string) *Buffer {
    	return &Buffer{buf: []byte(s)}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  5. cmd/object-api-listobjects_test.go

    	}
    	for _, object := range testObjects {
    		md5Bytes := md5.Sum([]byte(object.content))
    		_, err = obj.PutObject(context.Background(), object.parentBucket, object.name, mustGetPutObjReader(t, bytes.NewBufferString(object.content),
    			int64(len(object.content)), hex.EncodeToString(md5Bytes[:]), ""), ObjectOptions{
    			Versioned:   globalBucketVersioningSys.PrefixEnabled(object.parentBucket, object.name),
    			UserDefined: object.meta,
    		})
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 11:07:40 GMT 2024
    - 73.1K bytes
    - Viewed (0)
  6. cmd/object-api-multipart_test.go

    	for i, testCase := range testCases {
    		actualInfo, actualErr := obj.PutObjectPart(context.Background(), testCase.bucketName, testCase.objName, testCase.uploadID, testCase.PartID, mustGetPutObjReader(t, bytes.NewBufferString(testCase.inputReaderData), testCase.inputDataSize, testCase.inputMd5, testCase.inputSHA256), opts)
    		// All are test cases above are expected to fail.
    		if actualErr != nil && testCase.shouldPass {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 77.1K bytes
    - Viewed (0)
  7. src/bytes/example_test.go

    	b.Write([]byte("Hello "))
    	fmt.Fprintf(&b, "world!")
    	b.WriteTo(os.Stdout)
    	// Output: Hello world!
    }
    
    func ExampleBuffer_reader() {
    	// A Buffer can turn a string or a []byte into an io.Reader.
    	buf := bytes.NewBufferString("R29waGVycyBydWxlIQ==")
    	dec := base64.NewDecoder(base64.StdEncoding, buf)
    	io.Copy(os.Stdout, dec)
    	// Output: Gophers rule!
    }
    
    func ExampleBuffer_Bytes() {
    	buf := bytes.Buffer{}
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
Back to top