< Summary

Information
Class: Renci.SshNet.Messages.Connection.ChannelExtendedDataMessage
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelExtendedDataMessage.cs
Line coverage
60%
Covered lines: 18
Uncovered lines: 12
Coverable lines: 30
Total lines: 82
Line coverage: 60%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_DataTypeCode()100%1100%
get_Data()100%1100%
get_BufferCapacity()100%10%
.ctor()100%1100%
.ctor(...)100%1100%
LoadData()100%1100%
SaveData()100%10%
Process(...)100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelExtendedDataMessage.cs

#LineLine coverage
 1namespace Renci.SshNet.Messages.Connection
 2{
 3    /// <summary>
 4    /// Represents SSH_MSG_CHANNEL_EXTENDED_DATA message.
 5    /// </summary>
 6    [Message("SSH_MSG_CHANNEL_EXTENDED_DATA", 95)]
 7    public class ChannelExtendedDataMessage : ChannelMessage
 8    {
 9        /// <summary>
 10        /// Gets message data type code.
 11        /// </summary>
 9212        public uint DataTypeCode { get; private set; }
 13
 14        /// <summary>
 15        /// Gets message data.
 16        /// </summary>
 9217        public byte[] Data { get; private set; }
 18
 19        /// <summary>
 20        /// Gets the size of the message in bytes.
 21        /// </summary>
 22        /// <value>
 23        /// The size of the messages in bytes.
 24        /// </value>
 25        protected override int BufferCapacity
 26        {
 27            get
 028            {
 029                var capacity = base.BufferCapacity;
 030                capacity += 4; // DataTypeCode
 031                capacity += 4; // Data length
 032                capacity += Data.Length; // Data
 033                return capacity;
 034            }
 35        }
 36
 37        /// <summary>
 38        /// Initializes a new instance of the <see cref="ChannelExtendedDataMessage"/> class.
 39        /// </summary>
 4040        public ChannelExtendedDataMessage()
 4041        {
 4042        }
 43
 44        /// <summary>
 45        /// Initializes a new instance of the <see cref="ChannelExtendedDataMessage"/> class.
 46        /// </summary>
 47        /// <param name="localChannelNumber">The local channel number.</param>
 48        /// <param name="dataTypeCode">The message data type code.</param>
 49        /// <param name="data">The message data.</param>
 50        public ChannelExtendedDataMessage(uint localChannelNumber, uint dataTypeCode, byte[] data)
 651            : base(localChannelNumber)
 652        {
 653            DataTypeCode = dataTypeCode;
 654            Data = data;
 655        }
 56
 57        /// <summary>
 58        /// Loads the data.
 59        /// </summary>
 60        protected override void LoadData()
 4061        {
 4062            base.LoadData();
 4063            DataTypeCode = ReadUInt32();
 4064            Data = ReadBinary();
 4065        }
 66
 67        /// <summary>
 68        /// Saves the data.
 69        /// </summary>
 70        protected override void SaveData()
 071        {
 072            base.SaveData();
 073            Write(DataTypeCode);
 074            WriteBinaryString(Data);
 075        }
 76
 77        internal override void Process(Session session)
 4078        {
 4079            session.OnChannelExtendedDataReceived(this);
 4080        }
 81    }
 82}