It seems that EOF is never read in the Zlib stream.
Maybe because I exactly read the amount of bytes that I want to read.
PNG allows multiple IDAT chunks to be specified, so I need to handle that situation.
I just now need to implement the Adler32 checksum algorithm. I suppose the base class can be similar to the CRC class.
I can also have a common checksum interface along with a wrapped stream for handling that checksum since I have a number of classes which are just there for checksum checking.
So next thing to do is to implement the Adler32 checksum then PNGs should be
readable. Of course I believe the next graphical thing to do is
which should not be too difficult.
The implementation of Adler32 looks really simple.
The read Adler32 checksum is a bit wrong. Not too sure on that.
The checksum is against the uncompressed data, not the compressed data.
The inflate decompressor definitely needs some speedup because it is really slow.
Probably the best way to test rendering is to write an image editing software that runs on the environment. It would be a basic image editor, nothing too complex. That way I can work on a few other MIDP 3 details rather than just canvases. I suppose it would support mouse events but allow the cursor to be moved using soft keys/keyboard because there might not be a mouse at all. I suppose it could be called Squirrel Studio, which sounds pretty cheesy. Or maybe just Squirrel Paint. Or perhaps Squirrelbrush.
In the interpreter itself I can have a profiler, at least for the MIPS instructions. I can count the number of cycles a method takes.