There is a while statement through which data is read:

 int typeArr = 0; int newObj = 0; int name = 0; while ((Name = readInt()) != 0x00) // { int info = in .readUnsignedByte(); int Type = in .readUnsignedByte(); if (PropertySizeType == 1) { typeArr = in .readUnsignedByte(); for (int k = 0; k < typeArr; k++) { newObj = in .readUnsignedByte(); } } } 

The problem is that after the value of newObj read, it is necessary to switch to the position of this value, that is:

 in.seek(newObj) 

And then you need to use the same while (with all that is there) to read, since the data, starting from newObj , has the same structure as described above.

How is it possible to solve for Java 1.7, not much changing everything (for example, is it possible to do without Void and override ?).

    1 answer 1

    Recursion?

     void readData() { int typeArr = 0; int newObj = 0; int name = 0; while ((Name = readInt()) != 0x00) // { int info = in .readUnsignedByte(); int Type = in .readUnsignedByte(); if (PropertySizeType == 1) { typeArr = in .readUnsignedByte(); for (int k = 0; k < typeArr; k++) { newObj = in .readUnsignedByte(); in.seek(newObj); readData(); } } } } 

    Finish for yourself.
    If the stack is not interesting, then you can continue;

      int typeArr = 0; int newObj = 0; int name = 0; while ((Name = readInt()) != 0x00) // { int info = in .readUnsignedByte(); int Type = in .readUnsignedByte(); if (PropertySizeType == 1) { typeArr = in .readUnsignedByte(); for (int k = 0; k < typeArr; k++) { newObj = in .readUnsignedByte(); in.seek(newObj); continue; } } } 
    • And how else can it not be solved? I after all indicated that it is desirable to do without void? Or is it unreal? - LightFusion
    • If the stack is not interesting, then you can continue; - Alexey Malchenko
    • And you can see how it will look in the code? In my example - LightFusion
    • I suggested that you should understand further. Edited the answer. - Alexey Malchenko
    • I may not have added it somewhere, but my reading starts with while (at a certain position), and after reading newObj, I need to change the reading position for the while operator, and the code you added does something else (I an error occurs) I come across this for the first time - could you explain it in more detail? - LightFusion