private byte postDecryption(CipherState state,ByteBuffer inByteBuffer,long position,byte[] iv) throws IOException {
  byte padding=0;
  if (state.isReset()) {
    resetCipher(state,position,iv);
    padding=getPadding(position);
    inByteBuffer.position(padding);
  }
  return padding;
}

private byte postDecryption ( CipherState state , ByteBuffer inByteBuffer , long position , byte [ ] iv ) throws IOException { byte padding = 0 ; if ( state . isReset ( ) ) { resetCipher ( state , position , iv ) ; padding = getPadding ( position ) ; inByteBuffer . position ( padding ) ; } return padding ; }
this method is executed immediately after decryption . check whether cipher should be updated and recalculate padding if needed .
