public void releaseBuffer(){
  if ((buffer.capacity() > 4194304 && buffer.limit() * BIG_SIZE_INCREASE < buffer.capacity()) || (buffer.capacity() <= 4194304 && buffer.limit() * NORMAL_INCREASE < buffer.capacity())) {
    buffer=firstBuffer;
  }
}

public void releaseBuffer ( ) { if ( ( buffer . capacity ( ) > 4194304 && buffer . limit ( ) * BIG_SIZE_INCREASE < buffer . capacity ( ) ) || ( buffer . capacity ( ) <= 4194304 && buffer . limit ( ) * NORMAL_INCREASE < buffer . capacity ( ) ) ) { buffer = firstBuffer ; } }
reinitialized buffer to smaller size if needed to avoid memory consumption .
