Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for copyOfRange (0.24 sec)

  1. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

          ByteStreams.copy(inChannel, outChannel);
        }
        byte[] actual = out.toByteArray();
        for (int i = 0; i < 500 * chunkSize; i += chunkSize) {
          assertThat(Arrays.copyOfRange(actual, i, i + chunkSize)).isEqualTo(dummyData);
        }
      }
    
      public void testReadFully() throws IOException {
        byte[] b = new byte[10];
    
        assertThrows(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Platform.java

        T[] empty = reference.length == 0 ? reference : Arrays.copyOf(reference, 0);
        return Arrays.copyOf(empty, length);
      }
    
      /** Equivalent to Arrays.copyOfRange(source, from, to, arrayOfType.getClass()). */
      /*
       * Arrays are a mess from a nullness perspective, and Class instances for object-array types are
       * even worse. For now, we just suppress and move on with our lives.
       *
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 21:19:52 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/io/ByteStreamsTest.java

          ByteStreams.copy(inChannel, outChannel);
        }
        byte[] actual = out.toByteArray();
        for (int i = 0; i < 500 * chunkSize; i += chunkSize) {
          assertThat(Arrays.copyOfRange(actual, i, i + chunkSize)).isEqualTo(dummyData);
        }
      }
    
      public void testReadFully() throws IOException {
        byte[] b = new byte[10];
    
        assertThrows(
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java

        @Override
        public int bits() {
          return 32;
        }
    
        @Override
        public HashCode hashBytes(byte[] input, int off, int len) {
          return HashCode.fromBytes(Arrays.copyOfRange(input, off, off + len));
        }
      }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/hash/AbstractNonStreamingHashFunctionTest.java

        @Override
        public int bits() {
          return 32;
        }
    
        @Override
        public HashCode hashBytes(byte[] input, int off, int len) {
          return HashCode.fromBytes(Arrays.copyOfRange(input, off, off + len));
        }
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4.4K bytes
    - Viewed (0)
  6. guava-gwt/test-super/com/google/common/collect/testing/super/com/google/common/collect/testing/Platform.java

     *
     * @author Hayward Chan
     */
    final class Platform {
      // Class.cast is not supported in GWT.
      static void checkCast(Class<?> clazz, Object obj) {}
    
      static <T> T[] clone(T[] array) {
        return (T[]) Arrays.copyOfRange(array, 0, array.length);
      }
    
      // TODO: Consolidate different copies in one single place.
      static String format(String template, Object... args) {
        // start substituting the arguments into the '%s' placeholders
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.1K bytes
    - Viewed (0)
  7. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/Platform.java

      }
    
      static <T> T[] newArray(T[] reference, int length) {
        T[] empty = reference.length == 0 ? reference : Arrays.copyOf(reference, 0);
        return Arrays.copyOf(empty, length);
      }
    
      /** Equivalent to Arrays.copyOfRange(source, from, to, arrayOfType.getClass()). */
      static <T> T[] copy(Object[] source, int from, int to, T[] arrayOfType) {
        T[] result = newArray(arrayOfType, to - from);
        System.arraycopy(source, from, result, 0, to - from);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Jun 29 18:16:45 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/primitives/Bytes.java

       * {@code array}, or {@code -1} if there is no such occurrence.
       *
       * <p>More formally, returns the lowest index {@code i} such that {@code Arrays.copyOfRange(array,
       * i, i + target.length)} contains exactly the same elements as {@code target}.
       *
       * @param array the array to search for the sequence {@code target}
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/net/InetAddresses.java

        Inet4Address server = getInet4Address(Arrays.copyOfRange(bytes, 4, 8));
    
        int flags = ByteStreams.newDataInput(bytes, 8).readShort() & 0xffff;
    
        // Teredo obfuscates the mapped client port, per section 4 of the RFC.
        int port = ~ByteStreams.newDataInput(bytes, 10).readShort() & 0xffff;
    
        byte[] clientBytes = Arrays.copyOfRange(bytes, 12, 16);
        for (int i = 0; i < clientBytes.length; i++) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Dec 15 19:31:54 GMT 2023
    - 44K bytes
    - Viewed (1)
  10. android/guava-tests/test/com/google/common/hash/AbstractStreamingHasherTest.java

      private static class Control extends AbstractNonStreamingHashFunction {
        @Override
        public HashCode hashBytes(byte[] input, int off, int len) {
          return HashCode.fromBytes(Arrays.copyOfRange(input, off, off + len));
        }
    
        @Override
        public int bits() {
          throw new UnsupportedOperationException();
        }
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.5K bytes
    - Viewed (0)
Back to top