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

    out.size += byteCount;

    // 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 one segment at a time.
    for (; byteCount > 0; s = s.next) {
      Segment copy = s.sharedCopy();
      copy.pos += offset;
      copy.limit = Math.min(copy.pos + (int) byteCount, copy.limit);
      if (out.head == null) {
        out.head = copy.next = copy.prev = copy;
      } else {
        out.head.prev.push(copy);
      }
      byteCount -= copy.limit - copy.pos;
      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(Buffer out, long offset, long byteCount) {
    if (out == null) throw new IllegalArgumentException("out == null");
    checkOffsetAndCount(size, offset, byteCount);
    if (byteCount == 0) return this;
    out.size += byteCount;
    Segment s = head;
    for (; offset >= (s.limit - s.pos); s = s.next) {
      offset -= (s.limit - s.pos);
    }
    for (; byteCount > 0; s = s.next) {
      Segment copy = s.sharedCopy();
      copy.pos += offset;
      copy.limit = Math.min(copy.pos + (int) byteCount, copy.limit);
      if (out.head == null) {
        out.head = copy.next = copy.prev = copy;
      } else {
        out.head.prev.push(copy);
      }
      byteCount -= copy.limit - copy.pos;
      offset = 0;
    }
    return this;
  }
public final Buffer copyTo ( Buffer out , long offset , long byteCount ) { if ( out == null ) throw new IllegalArgumentException ( "out == null" ) ; checkOffsetAndCount ( size , offset , byteCount ) ; if ( byteCount == 0 ) return this ; out . size += byteCount ; Segment s = head ; for ( ; offset >= ( s . limit - s . pos ) ; s = s . next ) { offset -= ( s . limit - s . pos ) ; } for ( ; byteCount > 0 ; s = s . next ) { Segment copy = s . sharedCopy ( ) ; copy . pos += offset ; copy . limit = Math . min ( copy . pos + ( int ) byteCount , copy . limit ) ; if ( out . head == null ) { out . head = copy . next = copy . prev = copy ; } else { out . head . prev . push ( copy ) ; } byteCount -= copy . limit - copy . pos ; 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 one segment at a time.