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

    Segment s = head;
    while (byteCount > 0) {
      int toCopy = (int) Math.min(byteCount, s.limit - s.pos);
      out.write(s.data, s.pos, toCopy);

      s.pos += toCopy;
      size -= toCopy;
      byteCount -= toCopy;

      if (s.pos == s.limit) {
        Segment toRecycle = s;
        head = s = toRecycle.pop();
        SegmentPool.recycle(toRecycle);
      }
    }

    return this;
  }
/** Write {@code byteCount} bytes from this to {@code out}. */
Write  byteCount bytes from this to  out.
Write byteCount bytes from this to out .
public final Buffer writeTo(OutputStream out, long byteCount) throws IOException {
    if (out == null) throw new IllegalArgumentException("out == null");
    checkOffsetAndCount(size, 0, byteCount);
    Segment s = head;
    while (byteCount > 0) {
      int toCopy = (int) Math.min(byteCount, s.limit - s.pos);
      out.write(s.data, s.pos, toCopy);
      s.pos += toCopy;
      size -= toCopy;
      byteCount -= toCopy;
      if (s.pos == s.limit) {
        Segment toRecycle = s;
        head = s = toRecycle.pop();
        SegmentPool.recycle(toRecycle);
      }
    }
    return this;
  }
public final Buffer writeTo ( OutputStream out , long byteCount ) throws IOException { if ( out == null ) throw new IllegalArgumentException ( "out == null" ) ; checkOffsetAndCount ( size , 0 , byteCount ) ; Segment s = head ; while ( byteCount > 0 ) { int toCopy = ( int ) Math . min ( byteCount , s . limit - s . pos ) ; out . write ( s . data , s . pos , toCopy ) ; s . pos += toCopy ; size -= toCopy ; byteCount -= toCopy ; if ( s . pos == s . limit ) { Segment toRecycle = s ; head = s = toRecycle . pop ( ) ; SegmentPool . recycle ( toRecycle ) ; } } return this ; }
Write {@code byteCount} bytes from this to {@code out}.
Write { @code byteCount } bytes from this to { @code out } .