Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 19 for newBuffer (0.14 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. src/test/java/jcifs/smb1/smb1/Trans2QueryFSInformationTest.java

    class Trans2QueryFSInformationTest {
    
        /** Small helper to create a byte buffer larger than the maximum expected
         *  wire format so that we can observe only the bytes written by a method.
         */
        private static byte[] newBuffer(int length) {
            // initialise with distinct pattern to detect unused trailing bytes
            byte[] buf = new byte[length];
            Arrays.fill(buf, (byte) 0xFF);
            return buf;
        }
    
        @Test
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 4.5K bytes
    - Click Count (0)
  2. android/guava/src/com/google/common/hash/AbstractNonStreamingHashFunction.java

          ByteBuffer newBuffer = ByteBuffer.allocate(newCapacity).order(ByteOrder.LITTLE_ENDIAN);
    
          // We must switch the old buffer to read mode to extract data
          Java8Compatibility.flip(buffer);
    
          newBuffer.put(buffer);
    
          // Swap references, newBuffer is already in write mode at the correct position
          this.buffer = newBuffer;
        }
    
        @Override
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Thu Dec 04 15:39:10 GMT 2025
    - 4.8K bytes
    - Click Count (0)
  3. src/test/java/jcifs/smb1/smb1/BufferCacheSecurityTest.java

                BufferCache.releaseBuffer(buffer);
            }
    
            // Then - Should be able to get buffers again
            byte[] newBuffer = BufferCache.getBuffer();
            assertNotNull(newBuffer, "Should be able to get buffer after release");
            assertEquals(SmbComTransaction.TRANSACTION_BUF_SIZE, newBuffer.length, "Buffer should have correct size");
        }
    
        /**
         * Test that invalid buffer sizes are rejected during release.
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sun Aug 31 08:00:57 GMT 2025
    - 9.6K bytes
    - Click Count (0)
  4. internal/ringbuffer/README.md

    	fmt.Println(rb.Length())
    	fmt.Println(rb.Free())
    
    	// read
    	buf := make([]byte, 4)
    	rb.Read(buf)
    	fmt.Println(string(buf))
    }
    ```
    
    It is possible to use an existing buffer with by replacing `New` with `NewBuffer`.
    
    
    # Blocking vs Non-blocking
    
    The default behavior of the ring buffer is non-blocking, 
    meaning that reads and writes will return immediately with an error if the operation cannot be completed.
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Wed May 15 00:11:04 GMT 2024
    - 2.1K bytes
    - Click Count (0)
  5. internal/ioutil/ioutil_test.go

    		src      io.Reader
    		skipLen  int64
    		expected string
    	}{
    		{bytes.NewBuffer([]byte("")), 0, ""},
    		{bytes.NewBuffer([]byte("")), 1, ""},
    		{bytes.NewBuffer([]byte("abc")), 0, "abc"},
    		{bytes.NewBuffer([]byte("abc")), 1, "bc"},
    		{bytes.NewBuffer([]byte("abc")), 2, "c"},
    		{bytes.NewBuffer([]byte("abc")), 3, ""},
    		{bytes.NewBuffer([]byte("abc")), 4, ""},
    	}
    	for i, testCase := range testCases {
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Tue Feb 18 16:25:55 GMT 2025
    - 5.6K bytes
    - Click Count (0)
  6. internal/s3select/sql/parser_test.go

    		}
    		// repr.Println(fex, repr.Indent("  "), repr.OmitEmpty(true))
    	}
    }
    
    func TestSqlLexer(t *testing.T) {
    	// s := bytes.NewBuffer([]byte("s.['name'].*.[*].abc.[\"abc\"]"))
    	s := bytes.NewBuffer([]byte("S3Object.words.*.id"))
    	// s := bytes.NewBuffer([]byte("COUNT(Id)"))
    	lex, err := sqlLexer.Lex(s)
    	if err != nil {
    		t.Fatal(err)
    	}
    	tokens, err := lexer.ConsumeAll(lex)
    	if err != nil {
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 9.2K bytes
    - Click Count (0)
  7. docs/debugging/healing-bin/main.go

    					r, err := file.Open()
    					if err != nil {
    						return err
    					}
    
    					b, err := io.ReadAll(r)
    					if err != nil {
    						return err
    					}
    					buf := bytes.NewBuffer(nil)
    					if _, err = msgp.CopyToJSON(buf, bytes.NewReader(b)); err != nil {
    						return err
    					}
    
    					dec := json.NewDecoder(buf)
    					// Use number to preserve integers.
    					dec.UseNumber()
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 3.1K bytes
    - Click Count (0)
  8. cmd/storage-datatypes_test.go

    	}
    
    	var buf bytes.Buffer
    	gob.NewEncoder(&buf).Encode(v)
    	encoded := buf.Bytes()
    	b.Log("Size:", buf.Len(), "bytes")
    	b.SetBytes(1)
    	b.ReportAllocs()
    
    	for b.Loop() {
    		dec := gob.NewDecoder(bytes.NewBuffer(encoded))
    		err := dec.Decode(&v)
    		if err != nil {
    			b.Fatal(err)
    		}
    	}
    }
    
    func BenchmarkEncodeDiskInfoMsgp(b *testing.B) {
    	v := DiskInfo{
    		Total:     1000,
    		Free:      1000,
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 9.1K bytes
    - Click Count (0)
  9. schema/serializer.go

    		switch v := dbValue.(type) {
    		case []byte:
    			bytesValue = v
    		default:
    			return fmt.Errorf("failed to unmarshal gob value: %#v", dbValue)
    		}
    		if len(bytesValue) > 0 {
    			decoder := gob.NewDecoder(bytes.NewBuffer(bytesValue))
    			err = decoder.Decode(fieldValue.Interface())
    		}
    	}
    	field.ReflectValueOf(ctx, dst).Set(fieldValue.Elem())
    	return
    }
    
    // Value implements serializer interface
    Created: Sun Apr 05 09:35:12 GMT 2026
    - Last Modified: Sun Oct 26 12:29:44 GMT 2025
    - 5.1K bytes
    - Click Count (0)
  10. internal/s3select/sql/jsonpath_test.go

    	"reflect"
    	"testing"
    
    	"github.com/alecthomas/participle"
    	"github.com/minio/minio/internal/s3select/jstream"
    )
    
    func getJSONStructs(b []byte) ([]any, error) {
    	dec := jstream.NewDecoder(bytes.NewBuffer(b), 0).ObjectAsKVS().MaxDepth(100)
    	var result []any
    	for parsedVal := range dec.Stream() {
    		result = append(result, parsedVal.Value)
    	}
    	if err := dec.Err(); err != nil {
    		return nil, err
    	}
    Created: Sun Apr 05 19:28:12 GMT 2026
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 2.7K bytes
    - Click Count (0)
Back to Top