Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 491 for Read (0.16 sec)

  1. guava-testlib/test/com/google/common/testing/FakeTickerTest.java

        assertEquals(0, ticker.read());
        assertEquals(10, ticker.read());
        assertEquals(20, ticker.read());
      }
    
      public void testAutoIncrementStep_millis() {
        FakeTicker ticker = new FakeTicker().setAutoIncrementStep(1, TimeUnit.MILLISECONDS);
        assertEquals(0, ticker.read());
        assertEquals(1000000, ticker.read());
        assertEquals(2000000, ticker.read());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 14:40:46 GMT 2024
    - 6.3K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/io/ByteStreams.java

          int off = (int) expectedSize - remaining;
          int read = in.read(bytes, off, remaining);
          if (read == -1) {
            // end of stream before reading expectedSize bytes
            // just return the bytes read so far
            return Arrays.copyOf(bytes, off);
          }
          remaining -= read;
        }
    
        // bytes is now full
        int b = in.read();
        if (b == -1) {
          return bytes;
        }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Jan 17 18:59:58 GMT 2024
    - 29.7K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/ByteStreamsTest.java

        assertEquals(2, lin.available());
        int read = lin.read();
        assertEquals(big[0], read);
        assertEquals(1, lin.available());
        read = lin.read();
        assertEquals(big[1], read);
        assertEquals(0, lin.available());
        read = lin.read();
        assertEquals(-1, read);
    
        lin.reset();
        byte[] small = new byte[5];
        read = lin.read(small);
        assertEquals(2, read);
        assertEquals(big[0], small[0]);
    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. src/main/java/jcifs/SmbRandomAccess.java

        void close () throws SmbException;
    
    
        /**
         * Read a single byte from the current position
         * 
         * @return read byte, -1 if EOF
         * @throws SmbException
         */
        int read () throws SmbException;
    
    
        /**
         * Read into buffer from current position
         * 
         * @param b
         *            buffer
         * @return number of bytes read
         * @throws SmbException
         */
    Java
    - Registered: Sun Apr 21 00:10:10 GMT 2024
    - Last Modified: Sun Jul 01 13:12:10 GMT 2018
    - 2.5K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/io/MultiReaderTest.java

        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());
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 3.7K bytes
    - Viewed (0)
  6. api/maven-api-core/src/main/java/org/apache/maven/api/services/xml/XmlFactory.java

    /**
     * Generic interface to read/write objects to/from XML.
     *
     * @param <T> the object type to read/write
     * @since 4.0.0
     */
    @Experimental
    public interface XmlFactory<T> extends Service {
    
        @Nonnull
        default T read(@Nonnull Path path) throws XmlReaderException {
            return read(path, true);
        }
    
        @Nonnull
        default T read(@Nonnull Path path, boolean strict) throws XmlReaderException {
    Java
    - Registered: Sun Apr 21 03:35:09 GMT 2024
    - Last Modified: Fri Nov 17 15:52:15 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/io/ByteStreamsTest.java

        assertEquals(2, lin.available());
        int read = lin.read();
        assertEquals(big[0], read);
        assertEquals(1, lin.available());
        read = lin.read();
        assertEquals(big[1], read);
        assertEquals(0, lin.available());
        read = lin.read();
        assertEquals(-1, read);
    
        lin.reset();
        byte[] small = new byte[5];
        read = lin.read(small);
        assertEquals(2, read);
        assertEquals(big[0], small[0]);
    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)
  8. android/guava-tests/test/com/google/common/io/ByteSourceTest.java

        // The stream reports no bytes... importantly, it doesn't read the byte at index 5 when it
        // should be reading the byte at index 10.
        // We could use a custom InputStream instead to make the read start at index 10, but since this
        // is a racy situation anyway, this behavior seems reasonable.
        assertEquals(-1, in.read());
      }
    
      private static class AppendableByteSource extends ByteSource {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.9K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/hash/HashingInputStreamTest.java

        HashingInputStream in = new HashingInputStream(Hashing.md5(), buffer);
    
        byte[] buf = new byte[100];
        int numOfByteRead = in.read(buf, 0, buf.length);
        assertEquals(-1, in.read()); // additional read
        assertEquals(4, numOfByteRead);
    
        assertEquals(expectedHash, in.hash());
      }
    
      public void testHash_hashesCorrectlyForSkipping() throws Exception {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Fri Oct 02 16:24:50 GMT 2020
    - 5K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/io/CountingInputStreamTest.java

        assertEquals(-1, counter.read());
        assertEquals(20, counter.getCount());
      }
    
      public void testReadArrayEOF() throws IOException {
        assertEquals(20, counter.read(new byte[30]));
        assertEquals(20, counter.getCount());
        assertEquals(-1, counter.read(new byte[30]));
        assertEquals(20, counter.getCount());
      }
    
      @SuppressWarnings("CheckReturnValue") // calling read() to skip a byte
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.5K bytes
    - Viewed (0)
Back to top