// Sender
checkBytesLeft(1);
if (content[offset++] != 0)
{
sender = new RemotePeer(AddressContainingPacket.bytesToAddress(this));
}
// Zulieferer
checkBytesLeft(1);
if (content[offset++] != 0)
{
supplier = new RemotePeer(AddressContainingPacket.bytesToAddress(this));
}
// Server
checkBytesLeft(1);
if (content[offset++] != 0)
{
server = new RemotePeer(AddressContainingPacket.bytesToAddress(this));
}
// Klassenname, wo das Ereignis auftrat
checkBytesLeft(1);
if (content[offset++] != 0)
{
byte[] sourceClassNameBytes = readByteArray();
sourceClassName = new String(sourceClassNameBytes);
}
// Nachrichten-Typ
byte[] messageTypeBytes = readByteArray();
messageType = new String(messageTypeBytes);
// Nachricht
byte[] messageBytes = readByteArray();
message = new String(messageBytes);
// Parameter lesen
// Anzahl Parameter
int numberOfParameters = readInt();
if (numberOfParameters != 0)
{
parameters = new Object[numberOfParameters];
}
else
{
parameters = null;
}
for (int i=0; i < numberOfParameters; i++)
{
checkBytesLeft(1);
byte type = content[offset++];
if (type == TYPE_REMOTEPEER)
{
parameters[i] = new RemotePeer(AddressContainingPacket.bytesToAddress(this));
}
else if (type == TYPE_INTEGER)
{
parameters[i] = new Integer(readInt());
}