@Override public void close() throws IOException, BadCiphertextException {
  if (outBytes_.length == 0) {
    outBytes_=new byte[cryptoHandler_.estimateOutputSize(0)];
    lastProcessedLen_=0;
  }
  int finalLen=cryptoHandler_.doFinal(outBytes_,lastProcessedLen_);
  outputStream_.write(outBytes_,lastProcessedLen_,finalLen);
  outputStream_.close();
}

@ Override public void close ( ) throws IOException , BadCiphertextException { if ( outBytes_ . length == 0 ) { outBytes_ = new byte [ cryptoHandler_ . estimateOutputSize ( 0 ) ] ; lastProcessedLen_ = 0 ; } int finalLen = cryptoHandler_ . doFinal ( outBytes_ , lastProcessedLen_ ) ; outputStream_ . write ( outBytes_ , lastProcessedLen_ , finalLen ) ; outputStream_ . close ( ) ; }
closes this output stream and releases any system resources associated with this stream . < p > this method writes any final bytes to the underlying stream that complete the cyptographic transformation of the written bytes . it also calls close on the wrapped outputstream .
