Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
 /// <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);
 }
 /// <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);
 }
 /// <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;
 }
 /// <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;
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }