larksuite-oapi/src/main/java/com/larksuite/oapi/okio1_17/Buffer.java
public final Buffer copyTo(OutputStream out, long offset, long byteCount) throws IOException {
    if (out == null) throw new IllegalArgumentException("out == null");
    checkOffsetAndCount(size, offset, byteCount);
    if (byteCount == 0) return this;

    // Skip segments that we aren't copying from.
    Segment s = head;
    for (; offset >= (s.limit - s.pos); s = s.next) {
      offset -= (s.limit - s.pos);
    }

    // Copy from one segment at a time.
    for (; byteCount > 0; s = s.next) {
      int pos = (int) (s.pos + offset);
      int toCopy = (int) Math.min(s.limit - pos, byteCount);
      out.write(s.data, pos, toCopy);
      byteCount -= toCopy;
      offset = 0;
    }

    return this;
  }
/**
   * Copy {@code byteCount} bytes from this, starting at {@code offset}, to
   * {@code out}.
   */
Copy  byteCount bytes from this, starting at  offset, to
out.
Copy byteCount bytes from this starting at offset to out .
public final Buffer copyTo(OutputStream out, long offset, long byteCount) throws IOException {
    if (out == null) throw new IllegalArgumentException("out == null");
    checkOffsetAndCount(size, offset, byteCount);
    if (byteCount == 0) return this;
    Segment s = head;
    for (; offset >= (s.limit - s.pos); s = s.next) {
      offset -= (s.limit - s.pos);
    }
    for (; byteCount > 0; s = s.next) {
      int pos = (int) (s.pos + offset);
      int toCopy = (int) Math.min(s.limit - pos, byteCount);
      out.write(s.data, pos, toCopy);
      byteCount -= toCopy;
      offset = 0;
    }
    return this;
  }
public final Buffer copyTo ( OutputStream out , long offset , long byteCount ) throws IOException { if ( out == null ) throw new IllegalArgumentException ( "out == null" ) ; checkOffsetAndCount ( size , offset , byteCount ) ; if ( byteCount == 0 ) return this ; Segment s = head ; for ( ; offset >= ( s . limit - s . pos ) ; s = s . next ) { offset -= ( s . limit - s . pos ) ; } for ( ; byteCount > 0 ; s = s . next ) { int pos = ( int ) ( s . pos + offset ) ; int toCopy = ( int ) Math . min ( s . limit - pos , byteCount ) ; out . write ( s . data , pos , toCopy ) ; byteCount -= toCopy ; offset = 0 ; } return this ; }
Copy {@code byteCount} bytes from this, starting at {@code offset}, to
 {@code out}.
Copy { @code byteCount } bytes from this starting at { @code offset } to { @code out } .
// Skip segments that we aren't copying from. // Copy from one segment at a time.