C# Класс Renci.SshNet.Common.SshDataStream

Specialized MemoryStream for reading and writing data SSH data.
Наследование: System.IO.MemoryStream
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ReadBigInt ( ) : BigInteger

Reads a BigInteger from the SSH datastream.

ReadBinary ( ) : byte[]

Reads a byte array from the SSH data stream.

ReadString ( Encoding encoding ) : string

Reads the next string data type from the SSH data stream.

ReadUInt32 ( ) : uint

Reads the next uint data type from the SSH data stream.

ReadUInt64 ( ) : ulong

Reads the next ulong data type from the SSH data stream.

SshDataStream ( byte buffer ) : System

Initializes a new non-resizable instance of the SshDataStream class based on the specified byte array.

SshDataStream ( byte buffer, int offset, int count ) : System

Initializes a new non-resizable instance of the SshDataStream class based on the specified byte array.

SshDataStream ( int capacity ) : System

Initializes a new instance of the SshDataStream class with an expandable capacity initialized as specified.

ToArray ( ) : byte[]

Writes the stream contents to a byte array, regardless of the MemoryStream.Position.

If the current instance was constructed on a provided byte array, a copy of the section of the array to which this instance has access is returned.

Write ( BigInteger data ) : void

Writes a BigInteger into the SSH data stream.

Write ( byte data ) : void

Writes bytes array data into the SSH data stream.

Write ( string s, Encoding encoding ) : void

Writes string data to the SSH data stream using the specified encoding.

Write ( uint value ) : void

Writes an uint to the SSH data stream.

Write ( ulong value ) : void

Writes an ulong to the SSH data stream.

WriteBinary ( byte buffer ) : void

Writes a buffer preceded by its length into the SSH data stream.

WriteBinary ( byte buffer, int offset, int count ) : void

Writes a buffer preceded by its length into the SSH data stream.

Приватные методы

Метод Описание
ReadBytes ( int length ) : byte[]

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

Описание методов

ReadBigInt() публичный Метод

Reads a BigInteger from the SSH datastream.
public ReadBigInt ( ) : BigInteger
Результат BigInteger

ReadBinary() публичный Метод

Reads a byte array from the SSH data stream.
public ReadBinary ( ) : byte[]
Результат byte[]

ReadString() публичный Метод

Reads the next string data type from the SSH data stream.
public ReadString ( Encoding encoding ) : string
encoding System.Text.Encoding
Результат string

ReadUInt32() публичный Метод

Reads the next uint data type from the SSH data stream.
public ReadUInt32 ( ) : uint
Результат uint

ReadUInt64() публичный Метод

Reads the next ulong data type from the SSH data stream.
public ReadUInt64 ( ) : ulong
Результат ulong

SshDataStream() публичный Метод

Initializes a new non-resizable instance of the SshDataStream class based on the specified byte array.
is null.
public SshDataStream ( byte buffer ) : System
buffer byte The array of unsigned bytes from which to create the current stream.
Результат System

SshDataStream() публичный Метод

Initializes a new non-resizable instance of the SshDataStream class based on the specified byte array.
is null.
public SshDataStream ( byte buffer, int offset, int count ) : System
buffer byte The array of unsigned bytes from which to create the current stream.
offset int The zero-based offset in at which to begin reading SSH data.
count int The number of bytes to load.
Результат System

SshDataStream() публичный Метод

Initializes a new instance of the SshDataStream class with an expandable capacity initialized as specified.
public SshDataStream ( int capacity ) : System
capacity int The initial size of the internal array in bytes.
Результат System

ToArray() публичный Метод

Writes the stream contents to a byte array, regardless of the MemoryStream.Position.
If the current instance was constructed on a provided byte array, a copy of the section of the array to which this instance has access is returned.
public ToArray ( ) : byte[]
Результат byte[]

Write() публичный Метод

Writes a BigInteger into the SSH data stream.
public Write ( BigInteger data ) : void
data BigInteger The to write.
Результат void

Write() публичный Метод

Writes bytes array data into the SSH data stream.
is null.
public Write ( byte data ) : void
data byte Byte array data to write.
Результат void

Write() публичный Метод

Writes string data to the SSH data stream using the specified encoding.
is null. is null.
public Write ( string s, Encoding encoding ) : void
s string The string data to write.
encoding System.Text.Encoding The character encoding to use.
Результат void

Write() публичный Метод

Writes an uint to the SSH data stream.
public Write ( uint value ) : void
value uint data to write.
Результат void

Write() публичный Метод

Writes an ulong to the SSH data stream.
public Write ( ulong value ) : void
value ulong data to write.
Результат void

WriteBinary() публичный Метод

Writes a buffer preceded by its length into the SSH data stream.
is null.
public WriteBinary ( byte buffer ) : void
buffer byte The data to write.
Результат void

WriteBinary() публичный Метод

Writes a buffer preceded by its length into the SSH data stream.
is null. The sum of and is greater than the buffer length. or is negative.
public WriteBinary ( byte buffer, int offset, int count ) : void
buffer byte An array of bytes. This method write bytes from buffer to the current SSH data stream.
offset int The zero-based byte offset in at which to begin writing bytes to the SSH data stream.
count int The number of bytes to be written to the current SSH data stream.
Результат void