Example #1
0
        //PES 09115009 Added to support passing back just the byte array into a Queue
        /// <summary>
        /// Provides a means of processing PDU data
        /// </summary>
        /// <param name="buf">byte array containing the pdu data to process</param>
        /// <param name="endian">format of value types</param>
        /// <param name="dataQueue">Returns raw packets to a referenced Queue</param>
        public void ProcessRawPDU(byte[] buf, DISnet.DataStreamUtilities.EndianTypes.Endian endian, ref Queue <byte[]> dataQueue)
        {
            Endian = endian;

            foreach (byte[] pduRawByteArray in ProcessRawPDU(buf)) //Calling the method to get PDUs, increment through each in case more than one pdu in packet
            {
                dataQueue.Enqueue(pduRawByteArray);
            }
        }
 /// <summary>
 /// Constructor to create a DataOutputStream from an existing DataStream and setting the type of Endian to use
 /// </summary>
 /// <param name="ds"></param>
 /// <param name="endian"></param>
 public DataOutputStream(DISnet.DataStreamUtilities.DataStream ds, DISnet.DataStreamUtilities.EndianTypes.Endian endian)
 {
     dsPDU  = ds;
     Endian = endian;
 }
 /// <summary>
 /// Constructor to create the DataOutputStream
 /// </summary>
 public DataOutputStream(DISnet.DataStreamUtilities.EndianTypes.Endian endian)
 {
     dsPDU  = new DataStream();
     Endian = endian;
 }
Example #4
0
        //PES 09182009  Added to work with Mobile
        /// <summary>
        /// Used to unmarshal data back into the correct PDU type.
        /// </summary>
        /// <param name="pdu_type">PDU type</param>
        /// <param name="rawPDU">byte array containing the raw packets</param>
        /// <param name="endian">Endian type</param>
        /// <returns></returns>
        public static DIS1998net.Pdu UnMarshalRawPDU(DISnet.Utilities.PDUTypes.PDUType1998 pdu_type, byte[] rawPDU, DISnet.DataStreamUtilities.EndianTypes.Endian endian)
        {
            DataInputStream ds = new DataInputStream(rawPDU, endian);

            return(UnMarshalRawPDU(pdu_type, ds));
        }
Example #5
0
 public void ProcessPDU(Stream stream, DISnet.DataStreamUtilities.EndianTypes.Endian endian, out byte[] rawPDU)
 {
     Endian = endian;
     ProcessPDU(stream, out rawPDU);
 }
Example #6
0
 //PES 09112009 Added to support passing back just the byte array
 /// <summary>
 /// Provides a means of processing PDU data
 /// </summary>
 /// <param name="buf">byte array containing the pdu data to process</param>
 /// <param name="endian">format of value types</param>
 /// <returns>Collection of Raw byte[] PDUs</returns>
 public List <byte[]> ProcessRawPDU(byte[] buf, DISnet.DataStreamUtilities.EndianTypes.Endian endian)
 {
     Endian = endian;
     return(ProcessRawPDU(buf));
 }
        //PES 09115009 Added to support passing back just the byte array into a Queue
        /// <summary>
        /// Provides a means of processing PDU data 
        /// </summary>
        /// <param name="buf">byte array containing the pdu data to process</param>
        /// <param name="endian">format of value types</param>
        /// <param name="dataQueue">Returns raw packets to a referenced Queue</param>
        public void ProcessRawPDU(byte[] buf, DISnet.DataStreamUtilities.EndianTypes.Endian endian, ref Queue<byte[]> dataQueue)
        {
            Endian = endian;

            foreach (byte[] pduRawByteArray in ProcessRawPDU(buf)) //Calling the method to get PDUs, increment through each in case more than one pdu in packet
            {
                dataQueue.Enqueue(pduRawByteArray);
            }
        }
Example #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="buf"></param>
 /// <param name="endian"></param>
 /// <param name="length">The standard size of a PDU header.  The size of the pdu will be read from the header.
 /// Note: This value could have been a const but wanted to be more flexible</param>
 /// <returns></returns>
 public object ProcessPDU(Stream stream, DISnet.DataStreamUtilities.EndianTypes.Endian endian)
 {
     Endian = endian;
     return(ProcessPDU(stream));
 }
 //PES 09112009 Added to support passing back just the byte array
 /// <summary>
 /// Provides a means of processing PDU data 
 /// </summary>
 /// <param name="buf">byte array containing the pdu data to process</param>
 /// <param name="endian">format of value types</param>
 /// <returns>Collection of Raw byte[] PDUs</returns>
 public List<byte[]> ProcessRawPDU(byte[] buf, DISnet.DataStreamUtilities.EndianTypes.Endian endian)
 {
     Endian = endian;
     return ProcessRawPDU(buf);
 }
 public void ProcessPDU(Stream stream, DISnet.DataStreamUtilities.EndianTypes.Endian endian, out byte[] rawPDU)
 {
     Endian = endian;
     ProcessPDU(stream, out rawPDU);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="buf"></param>
 /// <param name="endian"></param>
 /// <param name="length">The standard size of a PDU header.  The size of the pdu will be read from the header. 
 /// Note: This value could have been a const but wanted to be more flexible</param>
 /// <returns></returns>
 public object ProcessPDU(Stream stream, DISnet.DataStreamUtilities.EndianTypes.Endian endian)
 {
     Endian = endian;
     return ProcessPDU(stream);
 }
Example #12
0
 /// <summary>
 /// Constructor to create new Input DataStream based upon a byte array and endian.
 /// </summary>
 /// <param name="ds">byte array</param>
 /// <param name="endian">type of endian</param>
 public DataInputStream(byte[] ds, DISnet.DataStreamUtilities.EndianTypes.Endian endian)
 {
     dsPDU.byteStream    = ds;
     dsPDU.streamCounter = 0;
     dsPDU.Endian        = endian;
 }
Example #13
0
 /// <summary>
 /// Constructor to create new DataInput Stream based upon a byte array.  Default endian based upon DataStream class.
 /// </summary>
 /// <param name="ds">byte array</param>
 public DataInputStream(DISnet.DataStreamUtilities.EndianTypes.Endian endian)
 {
     dsPDU = new DataStream();
     dsPDU.streamCounter = 0;
     Endian = endian;
 }