private void writeCentralFileHeader(JBZipEntry ze) throws IOException {
    writeOut(CFH_SIG);

    // version made by
    writeOutShort((ze.getPlatform() << 8) | 20);

    // version needed to extract
    writeOutShort(10);

    // general purpose bit flag
    writeOutShort(0);

    writeOutShort(ze.getMethod());

    writeOutLong(DosTime.javaToDosTime(ze.getTime()));

    writeOutLong(ze.getCrc());
    writeOutLong(ze.getCompressedSize());
    writeOutLong(ze.getSize());

    byte[] name = getBytes(ze.getName());
    writeOutShort(name.length);

    byte[] extra = ze.getCentralDirectoryExtraBytes();
    writeOutShort(extra.length);

    String comm = ze.getComment();
    if (comm == null) {
      comm = "";
    }
    byte[] commentB = getBytes(comm);
    writeOutShort(commentB.length);

    writeOutShort(0);
    writeOutShort(ze.getInternalAttributes());
    writeOutLong(ze.getExternalAttributes());
    // todo make this extra field optional
    writeOutLong(Math.min(ze.getHeaderOffset(), ZIP64_MAGIC));

    writeOut(name);
    writeOut(extra);
    writeOut(commentB);
  }
private void writeCentralFileHeader(JBZipEntry ze)