コード例 #1
0
        /// <summary>
        /// Marshal the PDU structure to bytes array.
        /// </summary>
        /// <param name="pdu">The PDU to marshal.</param>
        /// <param name="bLittleEndian">Indicates whether encode the numbers to little endian.</param>
        /// <returns>The marshaled byte array</returns>
        public static byte[] Marshal(BasePDU pdu, bool bLittleEndian)
        {
            PduMarshaler m = new PduMarshaler(bLittleEndian);

            pdu.Encode(m);
            return(m.RawData);
        }
コード例 #2
0
        /// <summary>
        /// Marshal the PDU structure to bytes array.
        /// </summary>
        /// <param name="pdu">The PDU to marshal.</param>
        /// <returns>The marshaled byte array</returns>
        public static byte[] Marshal(BasePDU pdu)
        {
            PduMarshaler m = new PduMarshaler();

            pdu.Encode(m);
            return(m.RawData);
        }
コード例 #3
0
 /// <summary>
 /// Unmarshal bytes array to the PDU structure.
 /// </summary>
 /// <param name="data">The bytes array to unmarshal.</param>
 /// <param name="pdu">The PDU to be filled.</param>
 /// <param name="bLittleEndian">Indicates whether encode the numbers to little endian.</param>
 /// <returns>The PDU</returns>
 public static bool Unmarshal(byte[] data, BasePDU pdu, bool bLittleEndian)
 {
     PduMarshaler m = new PduMarshaler(data, bLittleEndian);
     return pdu.Decode(m);
 }
コード例 #4
0
 /// <summary>
 /// Unmarshal bytes array to the PDU structure.
 /// </summary>
 /// <param name="data">The bytes array to unmarshal.</param>
 /// <param name="pdu">The PDU to be filled.</param>
 /// <returns>The PDU</returns>
 public static bool Unmarshal(byte[] data, BasePDU pdu)
 {
     PduMarshaler m = new PduMarshaler(data);
     return pdu.Decode(m);
 }
コード例 #5
0
 /// <summary>
 /// Marshal the PDU structure to bytes array.
 /// </summary>
 /// <param name="pdu">The PDU to marshal.</param>
 /// <param name="bLittleEndian">Indicates whether encode the numbers to little endian.</param>
 /// <returns>The marshaled byte array</returns>
 public static byte[] Marshal(BasePDU pdu, bool bLittleEndian)
 {
     PduMarshaler m = new PduMarshaler(bLittleEndian);
     pdu.Encode(m);
     return m.RawData;
 }
コード例 #6
0
 /// <summary>
 /// Marshal the PDU structure to bytes array.
 /// </summary>
 /// <param name="pdu">The PDU to marshal.</param>
 /// <returns>The marshaled byte array</returns>
 public static byte[] Marshal(BasePDU pdu)
 {
     PduMarshaler m = new PduMarshaler();
     pdu.Encode(m);
     return m.RawData;
 }
コード例 #7
0
        /// <summary>
        /// Unmarshal bytes array to the PDU structure.
        /// </summary>
        /// <param name="data">The bytes array to unmarshal.</param>
        /// <param name="pdu">The PDU to be filled.</param>
        /// <param name="bLittleEndian">Indicates whether encode the numbers to little endian.</param>
        /// <returns>The PDU</returns>
        public static bool Unmarshal(byte[] data, BasePDU pdu, bool bLittleEndian)
        {
            PduMarshaler m = new PduMarshaler(data, bLittleEndian);

            return(pdu.Decode(m));
        }
コード例 #8
0
        /// <summary>
        /// Unmarshal bytes array to the PDU structure.
        /// </summary>
        /// <param name="data">The bytes array to unmarshal.</param>
        /// <param name="pdu">The PDU to be filled.</param>
        /// <returns>The PDU</returns>
        public static bool Unmarshal(byte[] data, BasePDU pdu)
        {
            PduMarshaler m = new PduMarshaler(data);

            return(pdu.Decode(m));
        }