format/src/main/java/com/github/sadikovi/riff/io/StripeInputBuffer.java
/**
   * Copy data into provided byte buffer, it should have position and limit set accordingly to
   * indicate how many bytes need to transfered. Note that if this stripe input buffer contains
   * fewer bytes (potentially 0) than remaining in output buffer, output buffer will be modified to
   * reflect this change (limit will be resized, so remaining bytes are only those copied).
   * @param out buffer to copy into
   */
Copy data into provided byte buffer, it should have position and limit set accordingly to
indicate how many bytes need to transfered. Note that if this stripe input buffer contains
fewer bytes (potentially 0) than remaining in output buffer, output buffer will be modified to
reflect this change (limit will be resized, so remaining bytes are only those copied).
@param out buffer to copy into
Copy data into provided byte buffer it should have position and limit set accordingly to indicate how many bytes need to transfered . Note that if this stripe input buffer contains fewer bytes ( potentially 0 ) than remaining in output buffer output buffer will be modified to reflect this change ( limit will be resized so remaining bytes are only those copied ) . @param out buffer to copy into
public void copy(ByteBuffer out) {
    int remaining = Math.min(out.remaining(), data.length - offset);
    out.put(data, offset, remaining);
    offset += remaining;
    out.flip();
  }
public void copy ( ByteBuffer out ) { int remaining = Math . min ( out . remaining ( ) , data . length - offset ) ; out . put ( data , offset , remaining ) ; offset += remaining ; out . flip ( ) ; }
Copy data into provided byte buffer, it should have position and limit set accordingly to
 indicate how many bytes need to transfered.
Copy data into provided byte buffer it should have position and limit set accordingly to indicate how many bytes need to transfered .
// advance position // flip buffer to make it ready for reads; if we copied fewer bytes than remaining in buffer, // after flip limit will be set correctly, and position will be reset to 0