5 Also, class rewriting could be used for optimization. Say for example there is
6 an `ArrayList` but for one target, that uses a bunch of memory. Instead it
7 can be rewritten to be another class for example. This could be done for
8 anything for the most part.
12 One thing to consider for class rewrites is `Class.forName()` and the
13 `Class.name()` with `toString()`. Since technically code could detect or rely
14 on the name of a given class, but that would be a bit ugly anyway. That might
15 not be too much of an issue at all.
19 So do I write the constant pool first, or wait until later?
23 Write it first, but before that determine strings that are used in all
24 constants so that they are recorded first in a kind of string table.
28 I will need an efficient way to write the constant pool without wasting much
29 space. There will need to be 9 bytes at the minimum for each entry due to long
30 or double, however since those take up two spots that could be handled in
31 special cases. So this leaves 3 2-byte fields (for references). 3*2 == 6. Since
32 6 is rather off and a tag is needed also, make it 4 2-byte fields. However in
33 reality due to the way references refer to name and types, I only need two
34 2 byte entries, which is enough for int and float. So I suppose keep it at 6
35 bytes then. Long and double will just consume more space and have an illegal