public static void clearRemaining(ByteBuffer buffer){
  if (!buffer.hasRemaining()) {
    return;
  }
  int pos=buffer.position();
  clearRange(buffer,pos,pos + buffer.remaining());
}

public static void clearRemaining ( ByteBuffer buffer ) { if ( ! buffer . hasRemaining ( ) ) { return ; } int pos = buffer . position ( ) ; clearRange ( buffer , pos , pos + buffer . remaining ( ) ) ; }
sets all bits in the given remaining byte range to 0 .
