code: public void finish() throws IOException {
  		int lastBlockSize = (int)(byteCount % blockSize);
  		if(lastBlockSize!=0) {
  			while(lastBlockSize<blockSize) {
  				out.write(padding);
  				byteCount++;
  				lastBlockSize++;
  			}
  		}
  		out.flush();
  	}
docs: Pads and flushes without closing the underlying stream.