public IPSFile(byte[] in) { int i = 5, size; while (!subString(in, i, i + 3).equals("EOF")) { if ((in.length - i) < 8) { return; } size = (in[i + 3] << 8) & 0xFF00; size += in[i + 4] & 0xFF;    if (size == 0) {  addRecord(new IPSRecord(ByteBlock.wrap(in, i, 8)));  i += 8; } else { addRecord(new IPSRecord(ByteBlock.wrap(in, i, 5 + size)));  i += (5 + size); } } }
public IPSFile() {}
    public IPSFile(byte[] in)    {        int i = 5, size;        while (!subString(in, i, i + 3).equals("EOF"))        {            if ((in.length - i) < 8) //not enough space for more records            {                return;            }            size = (in[i + 3] << 8) & 0xFF00;            size += in[i + 4] & 0xFF;            //			System.out.println("Size: " + size);            if (size == 0)            {                //RLE record is 8 bytes: OF FS ET SI ZE RL ES CB                addRecord(new IPSRecord(ByteBlock.wrap(in, i, 8)));                //subString(in, i, (i + 8))));                i += 8;            }            else            {                addRecord(new IPSRecord(ByteBlock.wrap(in, i, 5 + size)));                //subString(in, i, (i + 5 + size))));                i += (5 + size);            }        }    }