Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 171 for Closes (0.17 sec)

  1. android/guava/src/com/google/common/io/Closer.java

     *
     * <pre>{@code
     * Closer closer = Closer.create();
     * try {
     *   InputStream in = closer.register(openInputStream());
     *   OutputStream out = closer.register(openOutputStream());
     *   // do stuff
     * } catch (Throwable e) {
     *   // ensure that any checked exception types other than IOException that could be thrown are
     *   // provided here, e.g. throw closer.rethrow(e, CheckedException.class);
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Mar 06 15:15:46 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/io/Closeables.java

       *
       * @param inputStream the input stream to be closed, or {@code null} in which case this method
       *     does nothing
       * @since 17.0
       */
      public static void closeQuietly(@CheckForNull InputStream inputStream) {
        try {
          close(inputStream, true);
        } catch (IOException impossible) {
          throw new AssertionError(impossible);
        }
      }
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/io/MultiReader.java

      MultiReader(Iterator<? extends CharSource> readers) throws IOException {
        this.it = readers;
        advance();
      }
    
      /** Closes the current reader and opens the next one, if any. */
      private void advance() throws IOException {
        close();
        if (it.hasNext()) {
          current = it.next().openStream();
        }
      }
    
      @Override
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 28 20:13:02 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/io/MultiInputStream.java

        advance();
      }
    
      @Override
      public void close() throws IOException {
        if (in != null) {
          try {
            in.close();
          } finally {
            in = null;
          }
        }
      }
    
      /** Closes the current input stream and opens the next one, if any. */
      private void advance() throws IOException {
        close();
        if (it.hasNext()) {
          in = it.next().openStream();
        }
      }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 28 20:13:02 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/ClosingFuture.java

        if (compareAndUpdateState(OPEN, WILL_CLOSE)) {
          logger.get().log(FINER, "will close {0}", this);
          future.addListener(
              new Runnable() {
                @Override
                public void run() {
                  checkAndUpdateState(WILL_CLOSE, CLOSING);
                  close();
                  checkAndUpdateState(CLOSING, CLOSED);
                }
              },
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 01 16:15:01 GMT 2024
    - 98.5K bytes
    - Viewed (0)
  6. guava-tests/test/com/google/common/io/CloserTest.java

      public void testCreate() {
        assertThat(Closer.create().suppressor).isInstanceOf(Closer.SuppressingSuppressor.class);
      }
    
      public void testNoExceptionsThrown() throws IOException {
        Closer closer = new Closer(suppressor);
    
        TestCloseable c1 = closer.register(TestCloseable.normal());
        TestCloseable c2 = closer.register(TestCloseable.normal());
        TestCloseable c3 = closer.register(TestCloseable.normal());
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Mar 06 15:15:46 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/AbstractClosingFutureTest.java

                    new ClosingCallable<TestCloseable>() {
                      @Override
                      public TestCloseable call(DeferredCloser closer) throws Exception {
                        closer.eventuallyClose(closeable1, closingExecutor);
                        closer.eventuallyClose(closeable2, closingExecutor);
                        return closeable3;
                      }
                    },
                    executor)
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 74.7K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/collect/TreeRangeSetTest.java

        rangeSet.add(Range.closed(3, 6));
        rangeSet.remove(Range.closed(6, 9));
        testInvariants(rangeSet);
        assertThat(rangeSet.asRanges()).containsExactly(Range.closedOpen(3, 6));
      }
    
      public void testRemoveExact() {
        TreeRangeSet<Integer> rangeSet = TreeRangeSet.create();
        rangeSet.add(Range.closed(3, 6));
        rangeSet.remove(Range.closed(3, 6));
        testInvariants(rangeSet);
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Dec 16 19:54:45 GMT 2020
    - 24.3K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/SimpleTimeLimiterTest.java

        Stopwatch stopwatch = Stopwatch.createStarted();
    
        String result = proxy.sleepThenReturnInput("x");
    
        assertThat(result).isEqualTo("x");
        assertThat(stopwatch.elapsed(MILLISECONDS)).isIn(Range.closed(DELAY_MS, ENOUGH_MS));
        assertThat(target.finished).isTrue();
      }
    
      public void testNewProxy_goodMethodWithNotEnoughTime() throws Exception {
        SampleImpl target = new SampleImpl(9999);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 9.5K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java

        ClosingFuture<Closeable> closingFuture =
            ClosingFuture.submit(
                new ClosingCallable<Closeable>() {
                  @Override
                  public Closeable call(DeferredCloser closer) throws Exception {
                    return closer.eventuallyClose(mockCloseable, executor);
                  }
                },
                executor);
        FluentFuture<Closeable> unused = closingFuture.finishToFuture();
        assertThrows(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
Back to top