larksuite-oapi/src/main/java/com/larksuite/oapi/okio1_17/AsyncTimeout.java
public final Source source(final Source source) {
    return new Source() {
      @Override public long read(Buffer sink, long byteCount) throws IOException {
        boolean throwOnTimeout = false;
        enter();
        try {
          long result = source.read(sink, byteCount);
          throwOnTimeout = true;
          return result;
        } catch (IOException e) {
          throw exit(e);
        } finally {
          exit(throwOnTimeout);
        }
      }

      @Override public void close() throws IOException {
        boolean throwOnTimeout = false;
        enter();
        try {
          source.close();
          throwOnTimeout = true;
        } catch (IOException e) {
          throw exit(e);
        } finally {
          exit(throwOnTimeout);
        }
      }

      @Override public Timeout timeout() {
        return AsyncTimeout.this;
      }

      @Override public String toString() {
        return "AsyncTimeout.source(" + source + ")";
      }
    };
  }
/**
   * Returns a new source that delegates to {@code source}, using this to implement timeouts. This
   * works best if {@link #timedOut} is overridden to interrupt {@code sink}'s current operation.
   */
Returns a new source that delegates to  source, using this to implement timeouts. This
works best if  #timedOut is overridden to interrupt  sink's current operation.
Returns a new source that delegates to source using this to implement timeouts . This works best if #timedOut is overridden to interrupt sink ' s current operation .
public final Source source(final Source source) {
    return new Source() {
      @Override public long read(Buffer sink, long byteCount) throws IOException {
        boolean throwOnTimeout = false;
        enter();
        try {
          long result = source.read(sink, byteCount);
          throwOnTimeout = true;
          return result;
        } catch (IOException e) {
          throw exit(e);
        } finally {
          exit(throwOnTimeout);
        }
      }
      @Override public void close() throws IOException {
        boolean throwOnTimeout = false;
        enter();
        try {
          source.close();
          throwOnTimeout = true;
        } catch (IOException e) {
          throw exit(e);
        } finally {
          exit(throwOnTimeout);
        }
      }
      @Override public Timeout timeout() {
        return AsyncTimeout.this;
      }
      @Override public String toString() {
        return "AsyncTimeout.source(" + source + ")";
      }
    };
  }
public final Source source ( final Source source ) { return new Source ( ) { @ Override public long read ( Buffer sink , long byteCount ) throws IOException { boolean throwOnTimeout = false ; enter ( ) ; try { long result = source . read ( sink , byteCount ) ; throwOnTimeout = true ; return result ; } catch ( IOException e ) { throw exit ( e ) ; } finally { exit ( throwOnTimeout ) ; } } @ Override public void close ( ) throws IOException { boolean throwOnTimeout = false ; enter ( ) ; try { source . close ( ) ; throwOnTimeout = true ; } catch ( IOException e ) { throw exit ( e ) ; } finally { exit ( throwOnTimeout ) ; } } @ Override public Timeout timeout ( ) { return AsyncTimeout . this ; } @ Override public String toString ( ) { return "AsyncTimeout.source(" + source + ")" ; } } ; }
Returns a new source that delegates to {@code source}, using this to implement timeouts.
Returns a new source that delegates to { @code source } using this to implement timeouts .