public static SCPStatementPledges Decode(XdrDataInputStream stream)
            {
                SCPStatementPledges decodedSCPStatementPledges = new SCPStatementPledges();
                SCPStatementType    discriminant = SCPStatementType.Decode(stream);

                decodedSCPStatementPledges.Discriminant = discriminant;
                switch (decodedSCPStatementPledges.Discriminant.InnerValue)
                {
                case SCPStatementType.SCPStatementTypeEnum.SCP_ST_PREPARE:
                    decodedSCPStatementPledges.Prepare = SCPStatementPrepare.Decode(stream);
                    break;

                case SCPStatementType.SCPStatementTypeEnum.SCP_ST_CONFIRM:
                    decodedSCPStatementPledges.Confirm = SCPStatementConfirm.Decode(stream);
                    break;

                case SCPStatementType.SCPStatementTypeEnum.SCP_ST_EXTERNALIZE:
                    decodedSCPStatementPledges.Externalize = SCPStatementExternalize.Decode(stream);
                    break;

                case SCPStatementType.SCPStatementTypeEnum.SCP_ST_NOMINATE:
                    decodedSCPStatementPledges.Nominate = SCPNomination.Decode(stream);
                    break;
                }
                return(decodedSCPStatementPledges);
            }
 public static void Encode(XdrDataOutputStream stream, SCPStatementType value)
 {
     stream.WriteInt((int)value.InnerValue);
 }