Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 131 for getBytes (0.19 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/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)
  3. 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)
  4. 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Jul 19 14:00:24 GMT 2016
    - 6.2K bytes
    - Viewed (0)
  5. android/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 May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  6. 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)
  7. src/main/java/jcifs/util/Strings.java

         */
        public static byte[] getBytes ( String str, Charset encoding ) {
            if ( str == null ) {
                return new byte[0];
            }
            return str.getBytes(encoding);
        }
    
    
        /**
         * 
         * @param str
         * @return the string as bytes (UTF16-LE)
         */
        public static byte[] getUNIBytes ( String str ) {
            return getBytes(str, UNI_ENCODING);
        }
    
    
        /**
    Java
    - Registered: Sun May 05 00:10:10 GMT 2024
    - Last Modified: Mon Mar 13 12:00:57 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  8. maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java

        }
    
        @Test
        void calculateByte() throws IOException {
            Map<ChecksumAlgorithmService.ChecksumAlgorithm, String> checksums = service.calculate(
                    "test".getBytes(StandardCharsets.UTF_8), service.select(Arrays.asList("SHA-1", "MD5")));
            assertNotNull(checksums);
            assertEquals(2, checksums.size());
    Java
    - Registered: Sun Apr 28 03:35:10 GMT 2024
    - Last Modified: Thu Dec 21 08:05:10 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  9. maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultTransport.java

                    throw new RuntimeException(e);
                }
                return false;
            }
        }
    
        @Override
        public Optional<byte[]> getBytes(URI relativeSource) {
            try {
                Path tempPath = null;
                try {
                    tempPath = Files.createTempFile("transport-get", "tmp");
                    if (get(relativeSource, tempPath)) {
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Thu May 02 16:33:18 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  10. 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)
Back to top