package a2geek.apple2.image.encoder.encode; import a2geek.apple2.image.encoder.A2Image; /** * Bit pack #3. *

* Pack image with the following format:
* %1nnn rrrr Repeat the next n+1 bytes r+1 times.
* %0nnn nnnn Copy the next n+1 bytes. *

* @author a2geek@users.noreply.github.com (sort of) */ public class BitPack3 extends A2Encoder { public String getTitle() { return "Bit Pack #3"; } public void encode(A2Image image, int maxSize) { byte[] data = image.getBytes(); encode(data, maxSize); } public void encode(byte[] data, int maxSize) { reset(maxSize); int unencodeStart = -1; for (int i=0; i 128) count = 128; addByte(0x00 + count - 1); for (int j=0; j