<PackageReference Include="SSH.NET" Version="2024.1.0" />

SshData

public abstract class SshData
Base ssh data serialization type.
protected virtual int BufferCapacity { get; }

Gets the size of the message in bytes.

protected SshDataStream DataStream { get; }

Gets the underlying SshDataStream that is used for reading and writing SSH data.

protected bool IsEndOfData { get; }

Gets a value indicating whether all data from the buffer has been read.

protected SshData()

public byte[] GetBytes()

Gets data bytes array.

public void Load(byte[] data)

Loads data from specified bytes.

public void Load(byte[] data, int offset, int count)

Loads data from the specified buffer.

protected abstract void LoadData()

Called when type specific data need to be loaded.

protected byte[] ReadBinary()

Reads next data type as byte array from internal buffer.

protected bool ReadBoolean()

Reads the next Boolean from the internal buffer.

protected byte ReadByte()

Reads next byte data type from internal buffer.

protected byte[] ReadBytes()

Reads all data left in internal buffer at current position.

protected byte[] ReadBytes(int length)

Reads next specified number of bytes data type from internal buffer.

protected Dictionary<string, string> ReadExtensionPair()

Reads next extension-pair data type from internal buffer.

protected string[] ReadNamesList()

Reads next name-list data type from internal buffer.

protected string ReadString(Encoding encoding = null)

Reads the next String from the internal buffer using the specified encoding.

protected ushort ReadUInt16()

Reads the next UInt16 from the internal buffer.

protected uint ReadUInt32()

Reads the next UInt32 from the internal buffer.

protected ulong ReadUInt64()

Reads the next UInt64 from the internal buffer.

protected abstract void SaveData()

Called when type specific data need to be saved.

protected void Write(byte[] data)

Writes bytes array data into internal buffer.

protected void Write(byte[] buffer, int offset, int count)

Writes a sequence of bytes to the current SSH data stream and advances the current position within this stream by the number of bytes written.

protected void Write(byte data)

Writes Byte data into internal buffer.

protected void Write(bool data)

Writes Boolean into internal buffer.

protected void Write(uint data)

Writes UInt32 data into internal buffer.

protected void Write(ulong data)

Writes UInt64 data into internal buffer.

protected void Write(string data)

Writes String data into internal buffer using default encoding.

protected void Write(string data, Encoding encoding)

Writes String data into internal buffer using the specified encoding.

protected void Write(BigInteger data)

Writes mpint data into internal buffer.

protected void Write(string[] data)

Writes name-list data into internal buffer.

protected void Write(IDictionary<string, string> data)

Writes extension-pair data into internal buffer.

protected void WriteBinary(byte[] buffer, int offset, int count)

Writes data into internal buffer.

protected void WriteBinaryString(byte[] buffer)

Writes data into internal buffer.

protected virtual void WriteBytes(SshDataStream stream)

Writes the current message to the specified SshDataStream.