private ExtraFieldData writeLocalFileHeader(JBZipEntry ze) throws IOException {
    long headerOffset = getWritten();
    ze.setHeaderOffset(headerOffset);

    if (myFile.isZip64()) {
      ze.addExtra(new Zip64ExtraField(new ZipUInt64(ze.getSize()),
                                      new ZipUInt64(ze.getCompressedSize()),
                                      new ZipUInt64(ze.getHeaderOffset())));
    }
    else if (headerOffset >= ZIP64_MAGIC) {
      throw new IOException("entry header offset is greater than maximal supported: " + headerOffset);
    }

    writeOut(LFH_SIG);

    // version needed to extract
    writeOutShort(myFile.isZip64() ? ZIP64_MIN_VERSION : ZIP_MIN_VERSION);

    // general purpose bit flag
    writeOutShort(0);

    writeOutShort(ze.getMethod());

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

    writeOutLong(ze.getCrc());

    if (ze.getCompressedSize() >= ZIP64_MAGIC) {
      throw new IOException("compressed size is greater than maximal supported: " + ze.getCompressedSize());
    }
    writeOutLong(ze.getCompressedSize());

    if (ze.getSize() >= ZIP64_MAGIC) {
      throw new IOException("size is greater than maximal supported: " + ze.getSize());
    }
    writeOutLong(ze.getSize());

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

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

    writeOut(name);

    long extraOffset = getWritten();
    writeOut(extra);
    return new ExtraFieldData(extraOffset, extra.length);
  }
private ExtraFieldData writeLocalFileHeader(JBZipEntry ze)