docs: public static void archive(String infilename, String outfilename,
                                 FileAccess storage,
                                 int compressionType) throws IOException {
  
          InputStream          in        = null;
          OutputStream         f         = null;
          DeflaterOutputStream deflater  = null;
          boolean              completed = false;
  
          // if there is no file
          if (!storage.isStreamElement(infilename)) {
              return;
          }
  
          try {
              byte[] b = new byte[COPY_BLOCK_SIZE];
  
              in = storage.openInputStreamElement(infilename);
              f  = storage.openOutputStreamElement(outfilename);
  
              switch (compressionType) {
  
                  case COMPRESSION_ZIP :
                      f = deflater = new DeflaterOutputStream(f,
                              new Deflater(Deflater.BEST_SPEED), b.length);
                      break;
  
                  case COMPRESSION_GZIP :
                      f = deflater = new GZIPOutputStream(f, b.length);
                      break;
  
                  case COMPRESSION_NONE :
                      break;
  
                  default :
                      throw new RuntimeException("FileArchiver"
                                                 + compressionType);
              }
  
              while (true) {
                  int l = in.read(b, 0, b.length);
  
                  if (l == -1) {
                      break;
                  }
  
                  f.write(b, 0, l);
              }
  
              completed = true;
          } catch (Throwable e) {
              throw FileUtil.toIOException(e);
          } finally {
              try {
                  if (in != null) {
                      in.close();
                  }
  
                  if (f != null) {
                      if (deflater != null) {
                          deflater.finish();
                      }
  
                      f.close();
                  }
  
                  if (!completed && storage.isStreamElement(outfilename)) {
                      storage.removeElement(outfilename);
                  }
              } catch (Throwable e) {
                  throw FileUtil.toIOException(e);
              }
          }
      }