Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 349 for Closer (0.2 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-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 May 03 12:43:13 GMT 2024
    - Last Modified: Wed Mar 06 15:15:46 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  3. 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 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  4. 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 May 03 12:43:13 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 74.7K bytes
    - Viewed (0)
  5. 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)
  6. internal/ioutil/ioutil.go

    		w.wLimit -= int64(n1)
    		return n, err
    	}
    	n1, err = w.Writer.Write(p)
    	w.wLimit -= int64(n1)
    	return n, err
    }
    
    // Close closes the LimitWriter. It behaves like io.Closer.
    func (w *LimitWriter) Close() error {
    	if closer, ok := w.Writer.(io.Closer); ok {
    		return closer.Close()
    	}
    	return nil
    }
    
    // LimitedWriter takes an io.Writer and returns an ioutil.LimitWriter.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 19 11:26:59 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/ClosingFuture.java

     *
     * <pre>{@code
     * FluentFuture<UserName> userName =
     *     ClosingFuture.submit(
     *             closer -> closer.eventuallyClose(database.newTransaction(), closingExecutor),
     *             executor)
     *         .transformAsync((closer, transaction) -> transaction.queryClosingFuture("..."), executor)
     *         .transform((closer, result) -> result.get("userName"), directExecutor())
    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)
  8. cmd/metacache-stream.go

    				continue
    			}
    		}
    	}()
    
    	return objs, nil
    }
    
    // Close and release resources.
    func (w *metacacheWriter) Close() error {
    	if w == nil || w.closer == nil {
    		return nil
    	}
    	w.streamWg.Wait()
    	err := w.closer()
    	w.closer = nil
    	return err
    }
    
    // Reset and start writing to new writer.
    // Close must have been called before this.
    func (w *metacacheWriter) Reset(out io.Writer) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/io/Files.java

        }
    
        @Override
        public byte[] read() throws IOException {
          Closer closer = Closer.create();
          try {
            FileInputStream in = closer.register(openStream());
            return ByteStreams.toByteArray(in, in.getChannel().size());
          } catch (Throwable e) {
            throw closer.rethrow(e);
          } finally {
            closer.close();
          }
        }
    
        @Override
        public String toString() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 15 16:12:13 GMT 2024
    - 33.1K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/reflect/ClassPathTest.java

        manifest.getMainAttributes().put(Attributes.Name.CLASS_PATH, jarFile.getName());
    
        Closer closer = Closer.create();
        try {
          FileOutputStream fileOut = closer.register(new FileOutputStream(jarFile));
          JarOutputStream jarOut = closer.register(new JarOutputStream(fileOut, manifest));
          for (String entry : entries) {
            jarOut.putNextEntry(new ZipEntry(entry));
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Fri Apr 26 14:02:27 GMT 2024
    - 24.9K bytes
    - Viewed (0)
Back to top