Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for createBuffer (0.05 sec)

  1. guava/src/com/google/common/io/CharStreams.java

    @GwtIncompatible
    public final class CharStreams {
    
      // 2K chars (4K bytes)
      private static final int DEFAULT_BUF_SIZE = 0x800;
    
      /** Creates a new {@code CharBuffer} for buffering reads or writes. */
      static CharBuffer createBuffer() {
        return CharBuffer.allocate(DEFAULT_BUF_SIZE);
      }
    
      private CharStreams() {}
    
      /**
       * Copies all characters between the {@link Readable} and {@link Appendable} objects. Does not
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Jul 30 17:25:01 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/io/LineReader.java

     * the License.
     */
    
    package com.google.common.io;
    
    import static com.google.common.base.Preconditions.checkNotNull;
    import static com.google.common.io.CharStreams.createBuffer;
    
    import com.google.common.annotations.GwtIncompatible;
    import com.google.common.annotations.J2ktIncompatible;
    import com.google.errorprone.annotations.CanIgnoreReturnValue;
    import java.io.IOException;
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Sun Dec 22 03:38:46 UTC 2024
    - 3K bytes
    - Viewed (0)
  3. guava/src/com/google/common/io/ByteStreams.java

      }
    
      /** Compares the contents of the two {@link InputStream}s for equality. */
      static boolean contentsEqual(InputStream in1, InputStream in2) throws IOException {
        byte[] buf1 = createBuffer();
        byte[] buf2 = createBuffer();
        while (true) {
          int read1 = read(in1, buf1, 0, BUFFER_SIZE);
          int read2 = read(in2, buf2, 0, BUFFER_SIZE);
          if (read1 != read2 || !arraysEqual(buf1, buf2, read1)) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Jul 17 15:26:41 UTC 2025
    - 31.1K bytes
    - Viewed (0)
  4. android/guava-tests/benchmark/com/google/common/io/CharStreamsCopyBenchmark.java

    @NullUnmarked
    public class CharStreamsCopyBenchmark {
      enum CopyStrategy {
        OLD {
          @Override
          long copy(Readable from, Appendable to) throws IOException {
            CharBuffer buf = CharStreams.createBuffer();
            long total = 0;
            while (from.read(buf) != -1) {
              ((Buffer) buf).flip();
              to.append(buf);
              total += buf.remaining();
              ((Buffer) buf).clear();
            }
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 3.2K bytes
    - Viewed (0)
Back to top