Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 94 for bytes (0.18 sec)

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

      }
    
      private static void assertMessageDigestHashing(byte[] input, String algorithmName) {
        try {
          MessageDigest digest = MessageDigest.getInstance(algorithmName);
          assertEquals(
              HashCode.fromBytes(digest.digest(input)), ALGORITHMS.get(algorithmName).hashBytes(input));
          for (int bytes = 4; bytes <= digest.getDigestLength(); bytes++) {
            assertEquals(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/io/FilesTest.java

      }
    
      public void testMap_readWrite() throws IOException {
        // Test data
        int size = 1024;
        byte[] expectedBytes = new byte[size];
        byte[] bytes = newPreFilledByteArray(1024);
    
        // Setup
        File file = createTempFile();
        Files.write(bytes, file);
    
        Random random = new Random();
        random.nextBytes(expectedBytes);
    
        // Test
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  3. guava-testlib/src/com/google/common/testing/Platform.java

      static <T> T reserialize(T object) {
        checkNotNull(object);
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        try {
          ObjectOutputStream out = new ObjectOutputStream(bytes);
          out.writeObject(object);
          ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
          return (T) requireNonNull(in.readObject());
        } catch (IOException | ClassNotFoundException e) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Aug 23 12:13:11 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  4. android/guava-testlib/src/com/google/common/testing/Platform.java

      static <T> T reserialize(T object) {
        checkNotNull(object);
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        try {
          ObjectOutputStream out = new ObjectOutputStream(bytes);
          out.writeObject(object);
          ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes.toByteArray()));
          return (T) requireNonNull(in.readObject());
        } catch (IOException | ClassNotFoundException e) {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Aug 23 12:13:11 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/SingletonImmutableSet.java

    final class SingletonImmutableSet<E> extends ImmutableSet<E> {
      // We deliberately avoid caching the asList and hashCode here, to ensure that with
      // compressed oops, a SingletonImmutableSet packs all the way down to the optimal 16 bytes.
    
      final transient E element;
    
      SingletonImmutableSet(E element) {
        this.element = Preconditions.checkNotNull(element);
      }
    
      @Override
      public int size() {
        return 1;
      }
    
      @Override
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Nov 30 21:54:06 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/hash/LittleEndianByteArray.java

       * has to explicitly reverse the order of the bytes as it packs them into the result which makes
       * it slower than the native version.
       *
       * @param input the input bytes
       * @param offset the offset into the array at which to start reading
       * @param length the number of bytes from the input to read
       * @return a long of a concatenated 8 bytes
       */
      static long load64Safely(byte[] input, int offset, int length) {
        long result = 0;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:40:56 GMT 2024
    - 9.7K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/hash/AbstractByteHasherTest.java

          out.write(b);
        }
    
        @Override
        protected void update(byte[] b, int off, int len) {
          out.write(b, off, len);
        }
    
        byte[] bytes() {
          return out.toByteArray();
        }
    
        void assertBytes(byte[] expected) {
          assertArrayEquals(expected, bytes());
        }
    
        @Override
        public HashCode hash() {
          return HashCode.fromBytesNoCopy(bytes());
        }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/primitives/BytesTest.java

                    new byte[] {(byte) 2, (byte) 3, (byte) 4}))
            .isEqualTo(2);
        assertThat(
                Bytes.indexOf(
                    new byte[] {(byte) 2, (byte) 2, (byte) 3, (byte) 4, (byte) 2, (byte) 3, (byte) 4},
                    new byte[] {(byte) 2, (byte) 3, (byte) 4}))
            .isEqualTo(1);
        assertThat(
                Bytes.indexOf(
                    new byte[] {(byte) 4, (byte) 3, (byte) 2},
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Feb 06 16:10:08 GMT 2024
    - 16.4K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/io/FilesTest.java

      }
    
      public void testMap_readWrite() throws IOException {
        // Test data
        int size = 1024;
        byte[] expectedBytes = new byte[size];
        byte[] bytes = newPreFilledByteArray(1024);
    
        // Setup
        File file = createTempFile();
        Files.write(bytes, file);
    
        Random random = new Random();
        random.nextBytes(expectedBytes);
    
        // Test
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 22.2K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/primitives/Chars.java

       * @throws IllegalArgumentException if {@code bytes} has fewer than 2 elements
       */
      @GwtIncompatible // doesn't work
      public static char fromByteArray(byte[] bytes) {
        checkArgument(bytes.length >= BYTES, "array too small: %s < %s", bytes.length, BYTES);
        return fromBytes(bytes[0], bytes[1]);
      }
    
      /**
       * Returns the {@code char} value whose byte representation is the given 2 bytes, in big-endian
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 23.5K bytes
    - Viewed (0)
Back to top