larksuite-oapi/src/main/java/com/larksuite/oapi/okio1_17/Segment.java
public final Segment split(int byteCount) {
    if (byteCount <= 0 || byteCount > limit - pos) throw new IllegalArgumentException();
    Segment prefix;

    // We have two competing performance goals:
    //  - Avoid copying data. We accomplish this by sharing segments.
    //  - Avoid short shared segments. These are bad for performance because they are readonly and
    //    may lead to long chains of short segments.
    // To balance these goals we only share segments when the copy will be large.
    if (byteCount >= SHARE_MINIMUM) {
      prefix = sharedCopy();
    } else {
      prefix = SegmentPool.take();
      System.arraycopy(data, pos, prefix.data, 0, byteCount);
    }

    prefix.limit = prefix.pos + byteCount;
    pos += byteCount;
    prev.push(prefix);
    return prefix;
  }
/**
   * Splits this head of a circularly-linked list into two segments. The first
   * segment contains the data in {@code [pos..pos+byteCount)}. The second
   * segment contains the data in {@code [pos+byteCount..limit)}. This can be
   * useful when moving partial segments from one buffer to another.
   *
   * <p>Returns the new head of the circularly-linked list.
   */
Splits this head of a circularly-linked list into two segments. The first
segment contains the data in  [pos..pos+byteCount). The second
segment contains the data in  [pos+byteCount..limit). This can be
useful when moving partial segments from one buffer to another.

Returns the new head of the circularly-linked list.
Splits this head of a circularly - linked list into two segments . The first segment contains the data in [ pos .. pos + byteCount ) . The second segment contains the data in [ pos + byteCount .. limit ) . This can be useful when moving partial segments from one buffer to another . Returns the new head of the circularly - linked list .
public final Segment split(int byteCount) {
    if (byteCount <= 0 || byteCount > limit - pos) throw new IllegalArgumentException();
    Segment prefix;
    if (byteCount >= SHARE_MINIMUM) {
      prefix = sharedCopy();
    } else {
      prefix = SegmentPool.take();
      System.arraycopy(data, pos, prefix.data, 0, byteCount);
    }
    prefix.limit = prefix.pos + byteCount;
    pos += byteCount;
    prev.push(prefix);
    return prefix;
  }
public final Segment split ( int byteCount ) { if ( byteCount <= 0 || byteCount > limit - pos ) throw new IllegalArgumentException ( ) ; Segment prefix ; if ( byteCount >= SHARE_MINIMUM ) { prefix = sharedCopy ( ) ; } else { prefix = SegmentPool . take ( ) ; System . arraycopy ( data , pos , prefix . data , 0 , byteCount ) ; } prefix . limit = prefix . pos + byteCount ; pos += byteCount ; prev . push ( prefix ) ; return prefix ; }
Splits this head of a circularly-linked list into two segments.
Splits this head of a circularly - linked list into two segments .
// We have two competing performance goals: //  - Avoid copying data. We accomplish this by sharing segments. //  - Avoid short shared segments. These are bad for performance because they are readonly and //    may lead to long chains of short segments. // To balance these goals we only share segments when the copy will be large.