Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 106 for buffer (0.16 sec)

  1. android/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 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 23 15:09:35 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/hash/HashingOutputStreamTest.java

        out.write(b);
    
        verify(hashFunction).newHasher();
        verify(hasher).putByte((byte) b);
        verifyNoMoreInteractions(hashFunction, hasher);
      }
    
      public void testWrite_putByteArray() throws Exception {
        byte[] buf = new byte[] {'y', 'a', 'm', 's'};
        HashingOutputStream out = new HashingOutputStream(hashFunction, buffer);
        out.write(buf);
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 3.1K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/Queues.java

      public static <E> int drain(
          BlockingQueue<E> q,
          Collection<? super E> buffer,
          int numElements,
          long timeout,
          TimeUnit unit)
          throws InterruptedException {
        Preconditions.checkNotNull(buffer);
        /*
         * This code performs one System.nanoTime() more than necessary, and in return, the time to
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 16K bytes
    - Viewed (0)
  4. 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 Apr 05 12:43:09 GMT 2024
    - Last Modified: Mon Apr 10 14:11:51 GMT 2023
    - 7K bytes
    - Viewed (0)
  5. guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java

              char[] buffer = new char[maxChars];
              int bufIndex = 0;
              int remaining = buffer.length;
              try (InputStreamReader reader = new InputStreamReader(byteSource.openStream(), cs)) {
                int nRead = 0;
                while (remaining > 0 && (nRead = reader.read(buffer, bufIndex, remaining)) != -1) {
                  bufIndex += nRead;
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  6. android/guava-tests/benchmark/com/google/common/io/ByteSourceAsCharSourceReadBenchmark.java

              char[] buffer = new char[maxChars];
              int bufIndex = 0;
              int remaining = buffer.length;
              try (InputStreamReader reader = new InputStreamReader(byteSource.openStream(), cs)) {
                int nRead = 0;
                while (remaining > 0 && (nRead = reader.read(buffer, bufIndex, remaining)) != -1) {
                  bufIndex += nRead;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/io/CharStreams.java

          to.append(buf);
          total += buf.remaining();
          Java8Compatibility.clear(buf);
        }
        return total;
      }
    
      // TODO(lukes): consider allowing callers to pass in a buffer to use, some callers would be able
      // to reuse buffers, others would be able to size them more appropriately than the constant
      // defaults
    
      /**
       * Copies all characters between the {@link Reader} and {@link StringBuilder} objects. Does not
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/math/Stats.java

            "Expected at least Stats.BYTES = %s remaining , got %s",
            BYTES,
            buffer.remaining());
        return new Stats(
            buffer.getLong(),
            buffer.getDouble(),
            buffer.getDouble(),
            buffer.getDouble(),
            buffer.getDouble());
      }
    
      private static final long serialVersionUID = 0;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 22K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/escape/UnicodeEscaper.java

     *
     * @author David Beaumont
     * @since 15.0
     */
    @GwtCompatible
    @ElementTypesAreNonnullByDefault
    public abstract class UnicodeEscaper extends Escaper {
      /** The amount of padding (chars) to use when growing the escape buffer. */
      private static final int DEST_PAD = 32;
    
      /** Constructor for use by subclasses. */
      protected UnicodeEscaper() {}
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jan 18 20:55:09 GMT 2022
    - 13.2K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/hash/HashTestUtils.java

            for (PrimitiveSink sink : sinks) {
              ByteBuffer buffer = ByteBuffer.wrap(value);
              Java8Compatibility.position(buffer, pos);
              Java8Compatibility.limit(buffer, limit);
              sink.putBytes(buffer);
              assertEquals(limit, buffer.limit());
              assertEquals(limit, buffer.position());
            }
          }
        },
        PUT_STRING() {
          @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Oct 10 19:45:10 GMT 2022
    - 25.3K bytes
    - Viewed (0)
Back to top