When serializing pack files for being packed in the resulting installer, we're writing the size of the original file to the pack stream for being able to get the size of bytes to read back later from the pack stream during installing. This has two inconveniences:
There is just written the size of the original file. This size might change when compressing it before serializing, so we can't really compress a packed file using an additional compressor stream.
Generally, the size is written to the pack stream itself before the file is serialized to the same stream, so if the serialized size changes after filtering or compression the unpacker doesn't notice this change and we can't change this size later after serializing, thus, the unpacker would receive the wrong number of bytes to deserialize.
Change the above drawbacks in this way:
Remove writing the size before serializing and replace this by writing the serialized pack data size after serializing, getting the number of written bytes from the final serializer stream.