2016/07/16

10:30

Appears the ZIP I write is corrupt.

10:37

So I have ZIP files written or so it seems, however now I must calculate the CRC for the data.

extracting: NO_COMPRESSION/-6643291408912800396   bad CRC 190244c2
	(should be 00000000)
extracting: NO_COMPRESSION/-1146679493194395133   bad CRC 4864d8cb
	(should be 00000000)

10:40

I do know that when I am to read the ZIP file as a stream I will need to remember the last 16 bytes read, to possibly detect when the end of the data is reached without needing to look at it or decompress it. This would only have to be done however, if the size and such are unknown at the time of archival. So for unknown archives, this would be a bit slower than usual. The package manager could use it since it only needs to read a single file.

10:45

So I potentially now need a more direct approach when it comes to the DataPipe although it does work for the most part. Although keeping a note of sizes could be a bit confusing, I would basically have something very similar anyway so there is no real sense in changing it.

11:35

I actually need a DataPipeOutputStream now. Actually the CRC code is not a data pipe, it is just a data faucet. Actually a sink.

12:22

It would probably be best for flush in the data pipes to just do nothing instead of failing if the stream is closed.

15:55

Ok, so now I have:

extracting: NO_COMPRESSION/-6643291408912800396 bad CRC 190244c2
	(should be 89d9b62d)
extracting: NO_COMPRESSION/-1146679493194395133 bad CRC 4864d8cb
	(should be a7137455)

Not too sure if the CRC is in the uncompressed data or the compressed data.

16:09

Looks like Integer was missing some methods.

16:12

Now I get 2e0311c7 and 1525fd52.

16:18

The table generator appeared incorrect, now I get c41fa162 and aefb6a0e.

16:25

Ok, so the polynomial is wrong, now it has been corrected and the CRC is properly calculated.

16:27

So now that I can write ZIP files, I just need to finish the test and then make it so that I can go back to the C or Java compiling JIT (which outputs source code in a streamed ZIP).

19:17

The namespace writer will need to be given an output or a means of writing data to some output stream for the cached form. Right now the cache writer is just standalone and there is no binding of the JITOutput to the namespace writer.