SquirrelJME/SquirrelJME

View on GitHub
assets/developer-notes/stephanie-gawroriski/2016/03/09.mkd

Summary

Maintainability
Test Coverage
# 2016/03/09

## 11:31

Today is also going to be a busy real life day. So what I need to work on next
is figuring out decompression and such. So what I first need is an input stream
that can be used in any position in the ZIP. So the base class works. This
would then be used for the stored stream or passed into the soon to be
deflator.

## 12:43

Would be the inflator.

## 12:44

`ZipFormatException` has to be renamed to something more generic with all of
the inner classes residing in it.

## 13:09

I could use the extra IO stuff in another project. Then I can use that for
example with CRC32 or a size limited input stream.

## 15:29

Looks like for the defalte algorithm I am going to need a bit based input
stream which can read values of arbitrary bit size.

## 20:57

There is a slight issue. DEFLATE uses a 32KiB sliding window, however that
might not be enough memory for certain systems if they have an extremely
limited RAM size. So decompressing could be very costly in terms of memory
usage. So I need a kind of dynamic sliding window which could potentially
deduplicate and compress chunks as needed. I suppose the first thing I should
do however is implement the actual sliding window and then possibly handle
compression following that. So basically I could use say huffman compression
on the fragments of the sliding window. Then sliding window fragments would be
active and be in WeakReferences for example. So when they are inactive they are
merged with other blocks potentially and compressed with a low memory consuming
huffman of sorts. Then once they become active they can be referenced. Also the
most recent block will always be active until it is down far enough in the
chain to become inactive.