using System;
namespace Renci.SshNet.Messages.Transport
{
///
/// Represents SSH_MSG_IGNORE message.
///
[Message("SSH_MSG_IGNORE", MessageNumber)]
public class IgnoreMessage : Message
{
internal const byte MessageNumber = 2;
///
/// Gets ignore message data if any.
///
public byte[] Data { get; private set; }
///
/// Initializes a new instance of the class
///
public IgnoreMessage()
{
Data = new byte[0];
}
#if TUNING
///
/// Gets the size of the message in bytes.
///
///
/// The size of the messages in bytes.
///
protected override int BufferCapacity
{
get
{
var capacity = base.BufferCapacity;
capacity += 4; // Data length
capacity += Data.Length; // Data
return capacity;
}
}
#endif
///
/// Initializes a new instance of the class.
///
/// The data.
public IgnoreMessage(byte[] data)
{
if (data == null)
throw new ArgumentNullException("data");
Data = data;
}
///
/// Called when type specific data need to be loaded.
///
protected override void LoadData()
{
#if TUNING
Data = ReadBinary();
#else
Data = ReadBinaryString();
#endif
}
///
/// Called when type specific data need to be saved.
///
protected override void SaveData()
{
WriteBinaryString(Data);
}
}
}