private void writeZip64CentralDirectory(long cdLength, long cdOffset) throws IOException {
    long offset = getWritten();

    writeOut(ZIP64_EOCD_SIG);

    writeOut(ZipUInt64
               .getBytes(SHORT   /* version made by */
                         + SHORT /* version needed to extract */
                         + WORD  /* disk number */
                         + WORD  /* disk with central directory */
                         + DWORD /* number of entries in CD on this disk */
                         + DWORD /* total number of entries */
                         + DWORD /* size of CD */
                         + (long) DWORD /* offset of CD */
               ));

    // version made by
    writeOut(ZipShort.getBytes(ZIP64_MIN_VERSION));
    // version needed to extract
    writeOut(ZipShort.getBytes(ZIP64_MIN_VERSION));

    // number of this disk
    writeOut(ZipLong.getBytes(0));

    // disk number of the start of central directory
    writeOut(ZipLong.getBytes(0));

    // total number of entries in the central directory on this disk
    int numOfEntriesOnThisDisk = myFile.getEntries().size();
    final byte[] numOfEntriesOnThisDiskData = ZipUInt64.getBytes(numOfEntriesOnThisDisk);
    writeOut(numOfEntriesOnThisDiskData);

    // number of entries
    final byte[] num = ZipUInt64.getBytes(myFile.getEntries().size());
    writeOut(num);

    // length and location of CD
    writeOut(ZipUInt64.getBytes(cdLength));
    writeOut(ZipUInt64.getBytes(cdOffset));

    // no "zip64 extensible data sector"

    // and now the "ZIP64 end of central directory locator"
    writeOut(ZIP64_EOCD_LOC_SIG);

    // disk number holding the ZIP64 EOCD record
    writeOut(ZipLong.getBytes(0));
    // relative offset of ZIP64 EOCD record
    writeOut(ZipUInt64.getBytes(offset));
    // total number of disks
    writeOut(ZipLong.getBytes(1));
  }
private void writeZip64CentralDirectory(long cdLength, long cdOffset)