C# Class Renci.SshNet.Common.SshDataStream

Specialized MemoryStream for reading and writing data SSH data.
Inheritance: System.IO.MemoryStream
Datei anzeigen Open project: sshnet/SSH.NET Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
ReadBytes ( int length ) : byte[]

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

Method Details

ReadBigInt() public method

Reads a BigInteger from the SSH datastream.
public ReadBigInt ( ) : BigInteger
return BigInteger

ReadBinary() public method

Reads a byte array from the SSH data stream.
public ReadBinary ( ) : byte[]
return byte[]

ReadString() public method

Reads the next string data type from the SSH data stream.
public ReadString ( Encoding encoding ) : string
encoding System.Text.Encoding
return string

ReadUInt32() public method

Reads the next uint data type from the SSH data stream.
public ReadUInt32 ( ) : uint
return uint

ReadUInt64() public method

Reads the next ulong data type from the SSH data stream.
public ReadUInt64 ( ) : ulong
return ulong

SshDataStream() public method

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.
return System

SshDataStream() public method

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.
return System

SshDataStream() public method

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.
return System

ToArray() public method

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[]
return byte[]

Write() public method

Writes a BigInteger into the SSH data stream.
public Write ( BigInteger data ) : void
data BigInteger The to write.
return void

Write() public method

Writes bytes array data into the SSH data stream.
is null.
public Write ( byte data ) : void
data byte Byte array data to write.
return void

Write() public method

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.
return void

Write() public method

Writes an uint to the SSH data stream.
public Write ( uint value ) : void
value uint data to write.
return void

Write() public method

Writes an ulong to the SSH data stream.
public Write ( ulong value ) : void
value ulong data to write.
return void

WriteBinary() public method

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.
return void

WriteBinary() public method

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.
return void