Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 75 for getBytes (0.17 sec)

  1. android/guava-tests/test/com/google/common/hash/Murmur3Hash32Test.java

        assertHash(expected, murmur3_32().hashBytes(string.getBytes(charset)));
        assertHash(expected, murmur3_32_fixed().hashBytes(string.getBytes(charset)));
        assertHash(expected, murmur3_32().newHasher().putBytes(string.getBytes(charset)).hash());
        assertHash(expected, murmur3_32_fixed().newHasher().putBytes(string.getBytes(charset)).hash());
      }
    
      private boolean allBmp(String string) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 08 13:56:22 GMT 2021
    - 8.6K bytes
    - Viewed (0)
  2. android/guava-tests/benchmark/com/google/common/hash/HashStringBenchmark.java

        for (int i = 0; i < reps; i++) {
          res +=
              System.identityHashCode(
                  hashFunctionEnum
                      .getHashFunction()
                      .hashBytes(strings[i & SAMPLE_MASK].getBytes(StandardCharsets.UTF_8)));
        }
        return res;
      }
    
      @Benchmark
      int hashUtf8GetBytesHasher(int reps) {
        int res = 0;
        for (int i = 0; i < reps; i++) {
          res +=
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 5.3K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/BaseEncodingTest.java

        assertThat(encoding.encode(decoded.getBytes(UTF_8))).isEqualTo(encoded);
      }
    
      private static void testEncodesWithOffset(
          BaseEncoding encoding, String decoded, int offset, int len, String encoded) {
        assertThat(encoding.encode(decoded.getBytes(UTF_8), offset, len)).isEqualTo(encoded);
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 24.6K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/base/CharsetsTest.java

      @GwtIncompatible // Non-UTF-8 Charset
      public void testWhyUsAsciiIsDangerous() {
        byte[] b1 = "朝日新聞".getBytes(Charsets.US_ASCII);
        byte[] b2 = "聞朝日新".getBytes(Charsets.US_ASCII);
        byte[] b3 = "????".getBytes(Charsets.US_ASCII);
        byte[] b4 = "ニュース".getBytes(Charsets.US_ASCII);
        byte[] b5 = "スューー".getBytes(Charsets.US_ASCII);
        // Assert they are all equal (using the transitive property)
        assertTrue(Arrays.equals(b1, b2));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu May 04 09:41:29 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/io/TestCharSource.java

      private final TestByteSource byteSource;
    
      public TestCharSource(String content, TestOption... options) {
        this.byteSource = new TestByteSource(content.getBytes(UTF_8), options);
      }
    
      @Override
      public boolean wasStreamOpened() {
        return byteSource.wasStreamOpened();
      }
    
      @Override
      public boolean wasStreamClosed() {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Apr 21 02:27:51 GMT 2017
    - 1.4K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/ByteSourceTester.java

            suite.addTest(
                suiteForBytes(
                    factory, entry.getValue().getBytes(Charsets.UTF_8), name, entry.getKey(), true));
          }
        }
        return suite;
      }
    
      static TestSuite suiteForString(
          ByteSourceFactory factory, String string, String name, String desc) {
        TestSuite suite = suiteForBytes(factory, string.getBytes(Charsets.UTF_8), name, desc, true);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/hash/AbstractStreamingHasher.java

       * even to an intermediate buffer) should be considerably more efficient than potentially
       * copying the CharSequence to a String and then calling getBytes(Charset) on that String, in
       * reality there are optimizations that make the getBytes(Charset) approach considerably faster,
       * at least for commonly used charsets like UTF-8.
       */
    
      @Override
      @CanIgnoreReturnValue
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 7.1K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/io/ResourcesTest.java

      }
    
      public void testToByteArray() throws IOException {
        URL resource = getClass().getResource("testdata/i18n.txt");
        assertThat(Resources.toByteArray(resource)).isEqualTo(I18N.getBytes(Charsets.UTF_8));
      }
    
      public void testReadLines() throws IOException {
        // TODO(chrisn): Check in a better resource
        URL resource = getClass().getResource("testdata/i18n.txt");
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 6.8K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/hash/Hasher.java

       */
      @CanIgnoreReturnValue
      @Override
      Hasher putUnencodedChars(CharSequence charSequence);
    
      /**
       * Equivalent to {@code putBytes(charSequence.toString().getBytes(charset))}.
       *
       * <p><b>Warning:</b> This method, which reencodes the input before hashing it, is useful only for
       * cross-language compatibility. For other use cases, prefer {@link #putUnencodedChars}, which is
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 5.5K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/hash/Crc32cHashFunctionTest.java

      public void testSomeOtherKnownValues() {
        assertCrc(0x22620404, "The quick brown fox jumps over the lazy dog".getBytes(UTF_8));
        assertCrc(0xE3069283, "123456789".getBytes(UTF_8));
        assertCrc(0xf3dbd4fe, "1234567890".getBytes(UTF_8));
        assertCrc(0xBFE92A83, "23456789".getBytes(UTF_8));
      }
    
      public void testAgainstSimplerImplementation() {
        Random r = new Random(1234567);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Dec 23 18:30:33 GMT 2020
    - 6.5K bytes
    - Viewed (0)
Back to top