int totalLen = dis.readInt() - Integer.SIZE/8;
byte[] buffer = new byte[totalLen];
dis.readFully(buffer);
Storage s = new Storage(buffer);
while (s.validPos()) {
StatusResponse sr = new StatusResponse(s);
ResponseContainer responseContainer;
if (sr.result() != Constants.RTYPE_OK) {
responseContainer = new ResponseContainer(sr, null);
}
else if (sr.id() == Constants.CMD_SIMSTEP2) {
int nSubResponses = s.readInt();
List<Command> subResponses = new ArrayList<Command>(
nSubResponses);
for (int i = 0; i < nSubResponses; i++) {
subResponses.add(new Command(s));
}