Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 75 for getBytes (0.25 sec)

  1. 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 08 13:56:22 GMT 2021
    - 8.6K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/io/SourceSinkFactories.java

          @Override
          public CharSource createSource(String string) throws IOException {
            return factory.createSource(string.getBytes(Charsets.UTF_8)).asCharSource(Charsets.UTF_8);
          }
    
          @Override
          public String getExpected(String data) {
            return new String(factory.getExpected(data.getBytes(Charsets.UTF_8)), Charsets.UTF_8);
          }
    
          @Override
          public void tearDown() throws IOException {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 12.7K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/hash/Murmur3_32HashFunction.java

              } else {
                int codePoint = Character.codePointAt(input, i);
                if (codePoint == c) {
                  // fall back to JDK getBytes instead of trying to handle invalid surrogates ourselves
                  putBytes(input.subSequence(i, utf16Length).toString().getBytes(charset));
                  return this;
                }
                i++;
                update(4, codePointToFourUtf8Bytes(codePoint));
              }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Jun 15 20:59:00 GMT 2022
    - 11.9K bytes
    - Viewed (0)
  4. 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 5.3K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
      private static final SecretKey SHA1_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
      private static final SecretKey SHA256_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
      private static final SecretKey SHA512_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13.8K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/hash/MacHashFunctionTest.java

          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacMD5");
      private static final SecretKey SHA1_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA1");
      private static final SecretKey SHA256_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA256");
      private static final SecretKey SHA512_KEY =
          new SecretKeySpec("secret key".getBytes(UTF_8), "HmacSHA512");
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 13.8K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/hash/FarmHashFingerprint64Test.java

        assertThat(fingerprint(stringA.getBytes(UTF_8)))
            .isNotEqualTo(fingerprint(stringB.getBytes(UTF_8)));
    
        // ISO 8859-1 only has 0-255 (ubyte) representation so throws away UTF-8 characters
        // greater than 127 (ie with their top bit set).
        // Don't attempt to do this in real code.
        assertEquals(
            fingerprint(stringA.getBytes(ISO_8859_1)), fingerprint(stringB.getBytes(ISO_8859_1)));
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Jun 26 15:56:47 GMT 2017
    - 6.2K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/ByteSinkTest.java

        assertTrue(sink.wasStreamClosed());
        assertArrayEquals(new byte[] {1, 2, 3, 4}, sink.getBytes());
      }
    
      public void testWrite_bytes() throws IOException {
        assertArrayEquals(new byte[0], sink.getBytes());
        sink.write(bytes);
    
        assertTrue(sink.wasStreamOpened() && sink.wasStreamClosed());
        assertArrayEquals(bytes, sink.getBytes());
      }
    
      public void testWriteFrom_inputStream() throws IOException {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/hash/Fingerprint2011Test.java

        assertThat(fingerprint(stringA.getBytes(UTF_8)))
            .isNotEqualTo(fingerprint(stringB.getBytes(UTF_8)));
    
        // ISO 8859-1 only has 0-255 (ubyte) representation so throws away UTF-8 characters
        // greater than 127 (ie with their top bit set).
        // Don't attempt to do this in real code.
        assertEquals(
            fingerprint(stringA.getBytes(ISO_8859_1)), fingerprint(stringB.getBytes(ISO_8859_1)));
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Dec 29 14:55:25 GMT 2021
    - 7.6K bytes
    - Viewed (0)
  10. 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu May 04 09:41:29 GMT 2023
    - 2.5K bytes
    - Viewed (0)
Back to top