byte[] byteArray = in.readByteArray();
ByteArrayInputStream array = new ByteArrayInputStream(byteArray);
java.util.zip.InflaterInputStream szlib = new java.util.zip.InflaterInputStream(array,
new java.util.zip.Inflater());
InputSerializer ser = new InputSerializer(szlib);
ser.setProtocolVersion(protocolVersion);
try {
typePerception = ser.readByte();
zoneid = (IRPZone.ID) ser.readObject(new IRPZone.ID(""));
addedRPObjects = new LinkedList<RPObject>();
deletedRPObjects = new LinkedList<RPObject>();
modifiedAddedAttribsRPObjects = new LinkedList<RPObject>();
modifiedDeletedAttribsRPObjects = new LinkedList<RPObject>();
int added = ser.readInt();
if (added > TimeoutConf.MAX_ARRAY_ELEMENTS) {
throw new IOException("Illegal request of an list of " + String.valueOf(added)
+ " size");
}
logger.debug(added + " added objects.");
for (int i = 0; i < added; ++i) {
RPObject object = (RPObject) ser.readObject(new RPObject());
setZoneid(object, zoneid.getID());
addedRPObjects.add(object);
}
int modAdded = ser.readInt();
if (modAdded > TimeoutConf.MAX_ARRAY_ELEMENTS) {
throw new IOException("Illegal request of an list of " + String.valueOf(modAdded)
+ " size");
}
logger.debug(modAdded + " modified Added objects..");
for (int i = 0; i < modAdded; ++i) {
RPObject object = (RPObject) ser.readObject(new RPObject());
setZoneid(object, zoneid.getID());
modifiedAddedAttribsRPObjects.add(object);
}
int modDeleted = ser.readInt();
if (modDeleted > TimeoutConf.MAX_ARRAY_ELEMENTS) {
throw new IOException("Illegal request of an list of " + String.valueOf(modDeleted)
+ " size");
}
logger.debug(modDeleted + " modified Deleted objects..");
for (int i = 0; i < modDeleted; ++i) {
RPObject object = (RPObject) ser.readObject(new RPObject());
setZoneid(object, zoneid.getID());
modifiedDeletedAttribsRPObjects.add(object);
}
int del = ser.readInt();
if (del > TimeoutConf.MAX_ARRAY_ELEMENTS) {
throw new IOException("Illegal request of an list of " + String.valueOf(del)
+ " size");
}
logger.debug(del + " deleted objects..");
for (int i = 0; i < del; ++i) {
RPObject object = (RPObject) ser.readObject(new RPObject());
setZoneid(object, zoneid.getID());
deletedRPObjects.add(object);
}
} catch (IOException ioe) {
InputStream stream = new java.util.zip.InflaterInputStream(new ByteArrayInputStream(
byteArray), new java.util.zip.Inflater());
NDC.push("message is [" + this + "]\n");
NDC.push("message dump is [\n" + Utility.dumpInputStream(stream) + "\n]\n");
logger.error("error in getMessage", ioe);
NDC.pop();
NDC.pop();
return;
}
/** Dynamic part */
array = new ByteArrayInputStream(in.readByteArray());
ser = new InputSerializer(array);
ser.setProtocolVersion(protocolVersion);
timestampPerception = ser.readInt();
logger.debug("read My RPObject");
byte modifiedAddedMyRPObjectPresent = ser.readByte();
if (modifiedAddedMyRPObjectPresent == 1) {
myRPObjectModifiedAdded = (RPObject) ser.readObject(new RPObject());
setZoneid(myRPObjectModifiedAdded, zoneid.getID());
} else {
myRPObjectModifiedAdded = null;
}
byte modifiedDeletedMyRPObjectPresent = ser.readByte();
if (modifiedDeletedMyRPObjectPresent == 1) {
myRPObjectModifiedDeleted = (RPObject) ser.readObject(new RPObject());
setZoneid(myRPObjectModifiedDeleted, zoneid.getID());
} else {
myRPObjectModifiedDeleted = null;
}
}