C# Класс Incog.Messaging.IncogStream

Incog Pipe Stream defines the data protocol for reading and writing strings on our stream.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
IncogStream ( Stream stream, SecureString passphrase ) : System

Initializes a new instance of the IncogStream class.

IncogStream ( Stream stream, SecureString passphrase, double entropy ) : System

Initializes a new instance of the IncogStream class.

ReadBytes ( ) : byte[]

Read a byte array from the underlying stream.

ReadString ( ) : string

Read a string from the underlying stream.

WriteBytes ( byte bytes ) : int

Write a byte array to the underlying buffer.

WriteString ( string text ) : int

Write a string to the underlying buffer.

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

Метод Описание
ReadUInt16 ( ) : ushort

Read a 2-byte unsigned integer, unencrypted, from the stream. If either the first or second byte is missing (-1), then 0 is returned.

WriteUInt16 ( ushort value ) : void

Write a 2-byte unsigned integer, unencrypted, to the stream.

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

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

Initializes a new instance of the IncogStream class.
public IncogStream ( Stream stream, SecureString passphrase ) : System
stream Stream The stream to write to and read from.
passphrase System.Security.SecureString The secure string used to encrypt messages written to the stream and decrypt messages read from the stream.
Результат System

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

Initializes a new instance of the IncogStream class.
public IncogStream ( Stream stream, SecureString passphrase, double entropy ) : System
stream Stream The stream to write to and read from.
passphrase System.Security.SecureString The secure string used to encrypt messages written to the stream and decrypt messages read from the stream.
entropy double The approximate Shannon Entropy value (between 1.00 and 7.80) to spoof.
Результат System

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

Read a byte array from the underlying stream.
public ReadBytes ( ) : byte[]
Результат byte[]

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

Read a string from the underlying stream.
public ReadString ( ) : string
Результат string

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

Write a byte array to the underlying buffer.
public WriteBytes ( byte bytes ) : int
bytes byte The byte array to write to the buffer.
Результат int

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

Write a string to the underlying buffer.
public WriteString ( string text ) : int
text string The text string to write to the buffer. The string will be converted to Unicode.
Результат int