Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 137 for buffers (0.16 sec)

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

        byte[] b = ByteStreams.toByteArray(in);
        assertThat(b).isEqualTo(new byte[0]);
      }
    
      public void testToByteArray_largeStream() throws IOException {
        // well, large enough to require multiple buffers
        byte[] expected = newPreFilledByteArray(10000000);
        InputStream in = new ByteArrayInputStream(expected);
        byte[] b = ByteStreams.toByteArray(in);
        assertThat(b).isEqualTo(expected);
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 21.9K bytes
    - Viewed (1)
  2. android/guava/src/com/google/common/escape/Platform.java

        // requireNonNull accommodates Android's @RecentlyNullable annotation on ThreadLocal.get
        return requireNonNull(DEST_TL.get());
      }
    
      /**
       * A thread-local destination buffer to keep us from creating new buffers. The starting size is
       * 1024 characters. If we grow past this we don't put it back in the threadlocal, we just keep
       * going and grow as needed.
       */
      private static final ThreadLocal<char[]> DEST_TL =
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Dec 15 19:31:54 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/io/ByteSource.java

          // 1. the string constructor can avoid an extra copy most of the time by correctly sizing the
          //    internal char array (hard to avoid using StringBuilder)
          // 2. we avoid extra copies into temporary buffers altogether
          // The downside is that this will cause us to store the file bytes in memory twice for a short
          // amount of time.
          return new String(ByteSource.this.read(), charset);
        }
    
        @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 26.2K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/io/Java8Compatibility.java

    import java.nio.Buffer;
    
    /**
     * Wrappers around {@link Buffer} methods that are covariantly overridden in Java 9+. See
     * https://github.com/google/guava/issues/3990
     */
    @J2ktIncompatible
    @GwtIncompatible
    @ElementTypesAreNonnullByDefault
    final class Java8Compatibility {
      static void clear(Buffer b) {
        b.clear();
      }
    
      static void flip(Buffer b) {
        b.flip();
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 28 20:13:02 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  5. guava/src/com/google/common/base/Java8Compatibility.java

    import java.nio.Buffer;
    
    /**
     * Wrappers around {@link Buffer} methods that are covariantly overridden in Java 9+. See
     * https://github.com/google/guava/issues/3990
     */
    @J2ktIncompatible
    @GwtIncompatible
    @ElementTypesAreNonnullByDefault
    final class Java8Compatibility {
      static void clear(Buffer b) {
        b.clear();
      }
    
      static void flip(Buffer b) {
        b.flip();
      }
    
    Java
    - Registered: Fri Apr 05 12:43:09 GMT 2024
    - Last Modified: Thu Feb 23 15:09:35 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/math/PairedStatsTest.java

      }
    
      public void testFromByteArrayWithTooShortArrayInputThrowsIllegalArgumentException() {
        byte[] buffer = MANY_VALUES_PAIRED_STATS.toByteArray();
        byte[] tooShortByteArray =
            ByteBuffer.allocate(buffer.length - 1)
                .order(ByteOrder.LITTLE_ENDIAN)
                .put(buffer, 0, buffer.length - 1)
                .array();
        assertThrows(
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 14K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/math/PairedStatsTest.java

      }
    
      public void testFromByteArrayWithTooShortArrayInputThrowsIllegalArgumentException() {
        byte[] buffer = MANY_VALUES_PAIRED_STATS.toByteArray();
        byte[] tooShortByteArray =
            ByteBuffer.allocate(buffer.length - 1)
                .order(ByteOrder.LITTLE_ENDIAN)
                .put(buffer, 0, buffer.length - 1)
                .array();
        assertThrows(
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 14K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/base/Utf8.java

       * {@link #isWellFormed(byte[])}. Note that this can be false even when {@code
       * isWellFormed(bytes)} is true.
       *
       * @param bytes the input buffer
       * @param off the offset in the buffer of the first byte to read
       * @param len the number of bytes to read from the buffer
       */
      public static boolean isWellFormed(byte[] bytes, int off, int len) {
        int end = off + len;
        checkPositionIndexes(off, end, bytes.length);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/math/StatsTest.java

      }
    
      public void testFromByteArray_withTooLongArrayInputThrowsIllegalArgumentException() {
        byte[] buffer = MANY_VALUES_STATS_VARARGS.toByteArray();
        byte[] tooLongByteArray =
            ByteBuffer.allocate(buffer.length + 2)
                .order(ByteOrder.LITTLE_ENDIAN)
                .put(buffer)
                .putChar('.')
                .array();
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Nov 09 22:49:56 GMT 2023
    - 32.1K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/graph/NetworkEquivalenceTest.java

        g2.addEdge(N1, N2, E12);
    
        assertThat(network).isNotEqualTo(g2);
      }
    
      // Node/edge sets and node/edge connections are the same, but directedness differs.
      @Test
      public void equivalent_selfLoop_directedVsUndirected() {
        network.addEdge(N1, N1, E11);
    
        MutableNetwork<Integer, String> g2 = createNetwork(oppositeType(edgeType));
        g2.addEdge(N1, N1, E11);
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Jun 22 19:09:27 GMT 2017
    - 5.9K bytes
    - Viewed (0)
Back to top