public BlockTableEntry getBlockTableEntry() {
		if (fileSize == 0 && sectorTable == null) {
			prepareWrite();
			sectorTable[1] = sectorTable[0];
			nextSector++;
		}
		if (sectorTable == null || nextSector + 1 != sectorTable.length) {
			throw new IllegalStateException("not written all sectors yet");
		}
		int flags = 0;
		flags |= 0x80000000; // isFile
		flags |= 0x04000000; // TODO: what is this for?
		if (isSingleUnit) {
			flags |= 0x01000000;
		}
		// if (isEncryptionAdjusted) {
		// 	flags |= 0x00020000;
		// }
		// if (isEncrypted) {
		// 	flags |= 0x00010000;
		// }
		if (isCompressed) {
			flags |= 0x00000200;
		}
		if (isImploded) {
			flags |= 0x00000100;
		}
		BlockTableEntry blockTableEntry = new BlockTableEntry(blockOffset,
				sectorTable[nextSector], (int) fileSize, flags);
		if (crc32 != null) {
			blockTableEntry.setExtCRC32((int) crc32.getValue());
		}
		if (md5 != null) {
			blockTableEntry.setExtMD5(md5.digest());
		}
		return blockTableEntry;
	}