larksuite-oapi/src/main/java/com/larksuite/oapi/okio1_17/Segment.java
public final void compact() {
    if (prev == this) throw new IllegalStateException();
    if (!prev.owner) return; // Cannot compact: prev isn't writable.
    int byteCount = limit - pos;
    int availableByteCount = SIZE - prev.limit + (prev.shared ? 0 : prev.pos);
    if (byteCount > availableByteCount) return; // Cannot compact: not enough writable space.
    writeTo(prev, byteCount);
    pop();
    SegmentPool.recycle(this);
  }
/**
   * Call this when the tail and its predecessor may both be less than half
   * full. This will copy data so that segments can be recycled.
   */
Call this when the tail and its predecessor may both be less than half
full. This will copy data so that segments can be recycled.
Call this when the tail and its predecessor may both be less than half full . This will copy data so that segments can be recycled .
public final void compact() {
    if (prev == this) throw new IllegalStateException();
    if (!prev.owner) return; 
    int byteCount = limit - pos;
    int availableByteCount = SIZE - prev.limit + (prev.shared ? 0 : prev.pos);
    if (byteCount > availableByteCount) return; 
    writeTo(prev, byteCount);
    pop();
    SegmentPool.recycle(this);
  }
public final void compact ( ) { if ( prev == this ) throw new IllegalStateException ( ) ; if ( ! prev . owner ) return ; int byteCount = limit - pos ; int availableByteCount = SIZE - prev . limit + ( prev . shared ? 0 : prev . pos ) ; if ( byteCount > availableByteCount ) return ; writeTo ( prev , byteCount ) ; pop ( ) ; SegmentPool . recycle ( this ) ; }
Call this when the tail and its predecessor may both be less than half
 full.
Call this when the tail and its predecessor may both be less than half full .
// Cannot compact: prev isn't writable. // Cannot compact: not enough writable space.