private void Write(GenericProtocol pNode, int pIndex, IStreamOutput pOutput) { if (ByteData != null) { pOutput.Write(ByteData); } pOutput.WriteShort((short)pIndex); // Rekursive Methode: Write((object)pNode, pIndex, pOutput); }
private void Write(Object pObject, int pIndex, IStreamOutput pOutput) { List <int> localNodeIndices = _nodeIndices[pIndex]; for (int i = 0; i < localNodeIndices.Count; i++) { int i6 = localNodeIndices[i]; switch (i6) { case 0: pOutput.WriteByte((byte)pObject); // Byte break; case 1: pOutput.WriteBoolean((bool)pObject); break; case 2: pOutput.WriteByte((byte)pObject); break; case 3: pOutput.WriteShort((short)pObject); break; case 4: pOutput.WriteInt((int)pObject); break; case 5: pOutput.WriteLong((long)pObject); break; case 6: pOutput.WriteFloat((float)pObject); break; case 7: pOutput.WriteDouble((double)pObject); break; case 8: pOutput.WriteChar((char)pObject); break; case 9: pOutput.WriteUTF((string)pObject); break; case 10: break; case 11: i++; i6 = localNodeIndices[i]; string localNodeName = _nodeNames[i6]; var listOfObjects = ((GenericProtocol)pObject).Get <List <object> >(localNodeName); if (listOfObjects == null) { pOutput.WriteByte(12); i++; break; } foreach (var t in listOfObjects) { pOutput.WriteByte(11); Write(t, i6, pOutput); } pOutput.WriteByte(12); i++; break; case 12: // Ende der Liste break; case 13: WriteChars((string)pObject, pOutput); break; default: Write(((GenericProtocol)pObject).Get <object>(_nodeNames[i6]), i6, pOutput); break; } } }