示例#1
0
 /// <summary>
 /// Un-marshal a byte array to PDU struct.
 /// </summary>
 /// <param name="binaryReader">A binary reader.</param>
 internal override void FromBytes(BinaryReader binaryReader)
 {
     rpc_vers                  = binaryReader.ReadByte();
     rpc_vers_minor            = binaryReader.ReadByte();
     PTYPE                     = (RpcePacketType)binaryReader.ReadByte();
     pfc_flags                 = (RpceCoPfcFlags)binaryReader.ReadByte();
     packed_drep               = new DataRepresentationFormatLabel();
     packed_drep.dataRepFormat = (RpceDataRepresentationFormat)binaryReader.ReadUInt16();
     packed_drep.reserved      = binaryReader.ReadUInt16();
     frag_length               = binaryReader.ReadUInt16();
     auth_length               = binaryReader.ReadUInt16();
     call_id                   = binaryReader.ReadUInt32();
 }
示例#2
0
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">A binary reader.</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            rpc_vers                  = binaryReader.ReadByte();
            rpc_vers_minor            = binaryReader.ReadByte();
            PTYPE                     = (RpcePacketType)binaryReader.ReadByte();
            pfc_flags                 = (RpceCoPfcFlags)binaryReader.ReadByte();
            packed_drep               = new DataRepresentationFormatLabel();
            packed_drep.dataRepFormat = (RpceDataRepresentationFormat)binaryReader.ReadUInt16();
            packed_drep.reserved      = binaryReader.ReadUInt16();
            frag_length               = binaryReader.ReadUInt16();
            auth_length               = binaryReader.ReadUInt16();
            call_id                   = binaryReader.ReadUInt32();

            if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
            {
                frag_length = EndianUtility.ReverseByteOrder(frag_length);
                auth_length = EndianUtility.ReverseByteOrder(auth_length);
                call_id     = EndianUtility.ReverseByteOrder(call_id);
            }
        }
 /// <summary>
 /// Un-marshal a byte array to PDU struct.
 /// </summary>
 /// <param name="binaryReader">A binary reader.</param>
 internal override void FromBytes(BinaryReader binaryReader)
 {
     rpc_vers = binaryReader.ReadByte();
     rpc_vers_minor = binaryReader.ReadByte();
     PTYPE = (RpcePacketType)binaryReader.ReadByte();
     pfc_flags = (RpceCoPfcFlags)binaryReader.ReadByte();
     packed_drep = new DataRepresentationFormatLabel();
     packed_drep.dataRepFormat = (RpceDataRepresentationFormat)binaryReader.ReadUInt16();
     packed_drep.reserved = binaryReader.ReadUInt16();
     frag_length = binaryReader.ReadUInt16();
     auth_length = binaryReader.ReadUInt16();
     call_id = binaryReader.ReadUInt32();
 }