code: private void closeFLACStream() throws IOException {
      //reset position in output stream to beginning.
      //re-write the updated stream info.
      checkForThreadErrors();
      if(DEBUG_LEV > 0)
        System.err.println("FLACEncoder::closeFLACStream : Begin");
      streamLock.lock();
      try {
        if(!flacStreamIsOpen)
          throw new IllegalStateException("Cannot close a non-opened stream");
        byte[] md5Hash = md5.getMD().digest();
        flacWriter.closeFLACStream(md5Hash, streamConfig);
        flacStreamIsOpen = false;
      } finally {
         streamLock.unlock();
      }
    }
docs: Close the current FLAC stream. Updates the stream header information.
  If called on a closed stream, operation is undefined. Do not do this.