9 Only about a month left for that Creator CI40 KickStarter, it will be pretty
10 nice to obtain those boards as I can do development on them.
14 I believe in my implementation of the JVM I am going to limit the maximum
15 number of loaded classes to 65,536. Basically classes would be referenced by
16 a two byte index. I could also reduce the class count and use the upper bits
17 for some special details potentially. I will probably need a flag to indicate
18 if something is a ROM class or a RAM class, so I suppose the upper bit would
19 work. So that means 32,768 built-in classes and 32,768 loadable classes. Since
20 Java ME only has a single class path, every built-in class will already be
21 loaded so to speak. That is the CLDC and everything else will be part of the
26 I am going to probably need JSR 177 for `MessageDigest` and such.
30 I believe I need a tester for the inflate algorithm with known input for
31 example, this way I know what to expect.
35 The internal `__escape` method in the test would probably be better if it did
36 not rely on `StringBuilder` as I am removing it right now. This way there is
37 no intermediary string to work with for example.
41 Never actually used huffman before. My literal representation check works to
42 make sure that the mask is always of the lowest mask value.
46 I can keep the huffman tree internally a secret so that in the future if I find
47 a better algorithm I can change to it without having to worry too much any code
48 uses it. Right now I suppose I will use objects and such and have a node
49 structure. The tree-like structure would be the easiest initially to implement
50 although it would use a bunch of memory.
54 I could store the tree in an actual array and just use `ArrayList` to simplify
55 implementation of it. The tree would always be some kind of multiple. It would
56 be treated as a binary tree with value nodes (`Integer`) or `null` if there is
57 no value at said position. So for a single bit there are two entries. However
58 if 2 bits there are four entries. So basically there is an entry for each
59 binary bit. Just the one thing that has to be done is that the tree has to be
60 recreated if a new depth is discovered.
64 I could actually use `Number` and have a special number. For example normal
65 values will appear as integers. There will be a special number which is of a
66 single instance which would be called a deferred value (which cannot have its
67 value taken) and is used to indicate that the end of the tree has not yet been
72 Actually it might be better to have a general purpose huffman tree which can
73 work with any kind of object. That would be the most effective.
77 The huffman tree could also extend `Map` and use `Integer` as its key, sort of.
78 However, in this case I would only support read-only access to the map because
79 putting in a key would not make sense because a bit length is required. Also,
80 the key might not even make sense because there would be upper regions of
81 zeroes that must be included also. Well, based on my own thinking, there will
82 always be unique tree nodes for each key, so that will work out. However the
83 iterator will not be able to give an exact path to use it when decoding. So
84 I would just make it iteration only so I could for example print the
85 representation of the tree using the basic map structure for example.
89 Also it probably does not make sense to have a `HuffmanTree` in *extra-io*, it
90 should probably instead be with the collections.
94 I could use an array, however say if I do not use all of the entries in it,
95 most would end up being wasted. Usually this is a problem with higher bit
96 counts. In general the huffman tree is rather lopsided. Using a bunch of nodes
97 would be simpler though and would increase the object count a bit though.
101 Looks like I was missing `isInstance()` in `Class`.
105 Thinking about it, I can just use a `HashMap` and use that instead of the
106 huffman tree. A red-black tree would also suffice too. Actually no, due to the
107 variable size nature of the bits.
111 So the first letter I decoded in the test that I found on the internet gives
112 me my first letter, which is 'T'. I need a bit queue which can fill an internal
113 queue when enough bits were put in.
117 Most likely for the fixed huffman table, I do not need to calculate the table
118 at all because I can use if statements and such to determine what the actual
119 value is. It would be very similar to UTF-8 handling. That would save on
120 speed because most of the values are very linear.
126 54657374696e6754657374696e67
129 Need to get read of that leading zero.
133 Actually my distances are miscalculated, I am treating values above 256 as
134 values to be added to the output when that should not be the case.
138 Even getting 84 in there is complex. Using the mask will not work because the
139 values are off so to speak.
143 The problem is that the 144-255 variant has all of the bits set which makes
144 masking troublesome because in all situations it is always true.
148 I would guess that I would use addition or subtraction on my input and figure
153 I just have to go through the process of elimitation. I already elimited D for
154 the initial value, I just need to eliminate the other 3.