larksuite-oapi/src/main/java/com/larksuite/oapi/okio1_17/GzipSource.java
private void updateCrc(Buffer buffer, long offset, long byteCount) {
    // Skip segments that we aren't checksumming.
    Segment s = buffer.head;
    for (; offset >= (s.limit - s.pos); s = s.next) {
      offset -= (s.limit - s.pos);
    }

    // Checksum one segment at a time.
    for (; byteCount > 0; s = s.next) {
      int pos = (int) (s.pos + offset);
      int toUpdate = (int) Math.min(s.limit - pos, byteCount);
      crc.update(s.data, pos, toUpdate);
      byteCount -= toUpdate;
      offset = 0;
    }
  }
/** Updates the CRC with the given bytes. */
Updates the CRC with the given bytes.
Updates the CRC with the given bytes .
private void updateCrc(Buffer buffer, long offset, long byteCount) {
    Segment s = buffer.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 toUpdate = (int) Math.min(s.limit - pos, byteCount);
      crc.update(s.data, pos, toUpdate);
      byteCount -= toUpdate;
      offset = 0;
    }
  }
private void updateCrc ( Buffer buffer , long offset , long byteCount ) { Segment s = buffer . 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 toUpdate = ( int ) Math . min ( s . limit - pos , byteCount ) ; crc . update ( s . data , pos , toUpdate ) ; byteCount -= toUpdate ; offset = 0 ; } }
Updates the CRC with the given bytes.
Updates the CRC with the given bytes .
// Skip segments that we aren't checksumming. // Checksum one segment at a time.