Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for skipFully (0.11 sec)

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

        String expected = begin + end;
        assertEquals(expected.charAt(0), joinedReader.read());
        CharStreams.skipFully(joinedReader, 1);
        assertEquals(expected.charAt(2), joinedReader.read());
        CharStreams.skipFully(joinedReader, 4);
        assertEquals(expected.charAt(7), joinedReader.read());
        CharStreams.skipFully(joinedReader, 1);
        assertEquals(expected.charAt(9), joinedReader.read());
        assertEquals(-1, joinedReader.read());
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 3.7K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/io/CharStreamsTest.java

        assertThrows(EOFException.class, () -> CharStreams.skipFully(reader, 6));
      }
    
      public void testSkipFully() throws IOException {
        String testString = "abcdef";
        Reader reader = new StringReader(testString);
    
        assertEquals(testString.charAt(0), reader.read());
        CharStreams.skipFully(reader, 1);
        assertEquals(testString.charAt(2), reader.read());
        CharStreams.skipFully(reader, 2);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 11.3K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/io/CharStreamsTest.java

        assertThrows(EOFException.class, () -> CharStreams.skipFully(reader, 6));
      }
    
      public void testSkipFully() throws IOException {
        String testString = "abcdef";
        Reader reader = new StringReader(testString);
    
        assertEquals(testString.charAt(0), reader.read());
        CharStreams.skipFully(reader, 1);
        assertEquals(testString.charAt(2), reader.read());
        CharStreams.skipFully(reader, 2);
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 11.3K bytes
    - Viewed (0)
  4. guava/src/com/google/common/io/CharStreams.java

       * @param n the number of characters to skip
       * @throws EOFException if this stream reaches the end before skipping all the characters
       * @throws IOException if an I/O error occurs
       */
      public static void skipFully(Reader reader, long n) throws IOException {
        checkNotNull(reader);
        while (n > 0) {
          long amt = reader.skip(n);
          if (amt == 0) {
            throw new EOFException();
          }
          n -= amt;
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Wed Jul 30 17:25:01 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/io/ByteArrayDataInput.java

      @Override
      void readFully(byte[] b);
    
      @Override
      void readFully(byte[] b, int off, int len);
    
      // not guaranteed to skip n bytes so result should NOT be ignored
      // use ByteStreams.skipFully or one of the read methods instead
      @Override
      int skipBytes(int n);
    
      @CanIgnoreReturnValue // to skip a byte
      @Override
      boolean readBoolean();
    
      @CanIgnoreReturnValue // to skip a byte
      @Override
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Fri Dec 27 20:25:25 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/io/MultiInputStreamTest.java

                          }
                        })
                    .iterator());
        assertEquals(0, multi.skip(-1));
        assertEquals(0, multi.skip(-1));
        assertEquals(0, multi.skip(0));
        ByteStreams.skipFully(multi, 20);
        assertEquals(20, multi.read());
      }
    
      public void testReadSingle_noStackOverflow() throws IOException {
        // https://github.com/google/guava/issues/2996
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/io/MultiInputStreamTest.java

                          }
                        })
                    .iterator());
        assertEquals(0, multi.skip(-1));
        assertEquals(0, multi.skip(-1));
        assertEquals(0, multi.skip(0));
        ByteStreams.skipFully(multi, 20);
        assertEquals(20, multi.read());
      }
    
      public void testReadSingle_noStackOverflow() throws IOException {
        // https://github.com/google/guava/issues/2996
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Tue May 13 18:46:00 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  8. guava/src/com/google/common/io/ByteStreams.java

       * @throws EOFException if this stream reaches the end before skipping all the bytes
       * @throws IOException if an I/O error occurs, or the stream does not support skipping
       */
      public static void skipFully(InputStream in, long n) throws IOException {
        long skipped = skipUpTo(in, n);
        if (skipped < n) {
          throw new EOFException(
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Jul 17 15:26:41 UTC 2025
    - 31.1K bytes
    - Viewed (0)
  9. guava/src/com/google/common/base/Joiner.java

     *
     * {@snippet :
     * Joiner joiner = Joiner.on("; ").skipNulls();
     *  . . .
     * return joiner.join("Harry", null, "Ron", "Hermione");
     * }
     *
     * <p>This returns the string {@code "Harry; Ron; Hermione"}. Note that all input elements are
     * converted to strings using {@link Object#toString()} before being appended.
     *
     * <p>If neither {@link #skipNulls()} nor {@link #useForNull(String)} is specified, the joining
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Apr 14 15:16:19 UTC 2025
    - 21K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/base/JoinerTest.java

      }
    
      public void testSkipNulls() {
        Joiner skipNulls = J.skipNulls();
        checkNoOutput(skipNulls, iterable);
        checkNoOutput(skipNulls, iterableNull);
        checkNoOutput(skipNulls, iterableNullNull);
        checkNoOutput(skipNulls, iterableFourNulls);
        checkResult(skipNulls, iterable1, "1");
        checkResult(skipNulls, iterable12, "1-2");
        checkResult(skipNulls, iterable123, "1-2-3");
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 12.7K bytes
    - Viewed (0)
Back to top