code: @Override
      public void flush() throws IOException
      {
          if (deflater != null)
          {
              writeTrailer();
          }
          else
          {
              if (inflater != null)
              {
                  if (inflater.finished() && !trailerRead)
                  {
                      ByteBuffer bb = ByteBuffer.allocate(bufSize);
                      int rc = read(bb);
                      while (rc != -1)
                      {
                          bb.clear();
                          rc = read(bb);
                      }
                  }
              }
          }
      }
docs: Finishes
  @throws IOException