C# Класс RemoteViewing.Vnc.VncStream

Provides methods for reading and sending VNC data over a Stream.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Close ( ) : void

Closes the current stream and releases any resources associated with the current stream.

DecodeString ( byte buffer, int offset, int count ) : string

Decodes a sequence of bytes from the specified byte array into a string.

EncodeString ( char chars, int offset, int count ) : byte[]

Decodes a sequence of bytes from the specified char array into a string.

EncodeString ( string @string ) : byte[]

Encodes all the characters in the specified string into a sequence of bytes.

Receive ( int count ) : byte[]

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

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

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

ReceiveByte ( ) : byte

Reads a byte from the stream and advances the position within the stream by one byte.

ReceiveRectangle ( ) : VncRectangle

Reads a VncRectangle from the stream and advances the position within the stream by 8 bytes.

ReceiveString ( int maxLength = 0xfff ) : string

Reads a string from the stream.

ReceiveUInt16BE ( ) : ushort

Reads a ushort in big-endian encoding from the stream and advances the position within the stream by two bytes.

ReceiveUInt32BE ( ) : uint

Reads a uint in big-endian encoding from the stream and advances the position within the stream by two bytes.

ReceiveVersion ( ) : System.Version

Receives version information from the stream.

Require ( bool condition, string message, Vnc reason ) : void

Throws a VncException if a specific condition is not met.

SanityCheck ( bool condition ) : void

Throws a VncException if a specific condition is not met.

Send ( byte buffer ) : void

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

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

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

SendByte ( byte value ) : void

Writes a byte to the current position in the stream and advances the position within the stream by one byte.

SendRectangle ( VncRectangle region ) : void

Writes a VncRectangle to the current position in the stream and advances the position within the stream by 8 bytes.

SendString ( string @string, bool includeLength = false ) : void

Writes a string in big endian encoding to the current position in the stream.

SendUInt16BE ( ushort value ) : void

Writes a ushort in big endian encoding to the current position in the stream and advances the position within the stream by two bytes.

SendUInt32BE ( uint value ) : void

Writes a uint in big endian encoding to the current position in the stream and advances the position within the stream by four bytes.

SendVersion ( System.Version version ) : void

Writes a Version in big endian encoding to the current position in the stream.

VncStream ( ) : System

Initializes a new instance of the VncStream class.

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

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

Closes the current stream and releases any resources associated with the current stream.
public Close ( ) : void
Результат void

DecodeString() публичный статический Метод

Decodes a sequence of bytes from the specified byte array into a string.
public static DecodeString ( byte buffer, int offset, int count ) : string
buffer byte /// The array containing the sequence of bytes to decode. ///
offset int /// The index of the first byte to decode. ///
count int /// The number of bytes to decode. ///
Результат string

EncodeString() публичный статический Метод

Decodes a sequence of bytes from the specified char array into a string.
public static EncodeString ( char chars, int offset, int count ) : byte[]
chars char /// The array containing the sequence of bytes to decode. ///
offset int /// The index of the first byte to decode. ///
count int /// The number of bytes to decode. ///
Результат byte[]

EncodeString() публичный статический Метод

Encodes all the characters in the specified string into a sequence of bytes.
public static EncodeString ( string @string ) : byte[]
@string string
Результат byte[]

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

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
public Receive ( int count ) : byte[]
count int /// The number of bytes to read. ///
Результат byte[]

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

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
public Receive ( byte buffer, int offset, int count ) : void
buffer byte /// An array of bytes. When this method returns, the buffer contains the specified byte array with /// the values between and ( + - 1) /// replaced by the bytes read from the current source. ///
offset int /// The zero-based byte offset in at which to begin storing the data /// read from the current stream. ///
count int /// The maximum number of bytes to be read from the current stream. ///
Результат void

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

Reads a byte from the stream and advances the position within the stream by one byte.
public ReceiveByte ( ) : byte
Результат byte

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

Reads a VncRectangle from the stream and advances the position within the stream by 8 bytes.
public ReceiveRectangle ( ) : VncRectangle
Результат VncRectangle

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

Reads a string from the stream.
public ReceiveString ( int maxLength = 0xfff ) : string
maxLength int /// The maximum length of the to /// read. ///
Результат string

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

Reads a ushort in big-endian encoding from the stream and advances the position within the stream by two bytes.
public ReceiveUInt16BE ( ) : ushort
Результат ushort

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

Reads a uint in big-endian encoding from the stream and advances the position within the stream by two bytes.
public ReceiveUInt32BE ( ) : uint
Результат uint

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

Receives version information from the stream.
public ReceiveVersion ( ) : System.Version
Результат System.Version

Require() публичный статический Метод

Throws a VncException if a specific condition is not met.
public static Require ( bool condition, string message, Vnc reason ) : void
condition bool /// The condition which should be met. ///
message string /// A that describes the error. ///
reason Vnc /// A that describes the error. ///
Результат void

SanityCheck() публичный статический Метод

Throws a VncException if a specific condition is not met.
public static SanityCheck ( bool condition ) : void
condition bool /// The condition which should be met. ///
Результат void

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

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
public Send ( byte buffer ) : void
buffer byte /// The bytes to write to the stream. ///
Результат void

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

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
public Send ( byte buffer, int offset, int count ) : void
buffer byte /// An array of bytes. This method copies bytes from to the current stream. ///
offset int /// The zero-based byte offset in at which to begin copying bytes to the current stream. ///
count int /// The number of bytes to be written to the current stream. ///
Результат void

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

Writes a byte to the current position in the stream and advances the position within the stream by one byte.
public SendByte ( byte value ) : void
value byte /// The to write to the stream. ///
Результат void

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

Writes a VncRectangle to the current position in the stream and advances the position within the stream by 8 bytes.
public SendRectangle ( VncRectangle region ) : void
region VncRectangle /// The to write to the stream. ///
Результат void

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

Writes a string in big endian encoding to the current position in the stream.
public SendString ( string @string, bool includeLength = false ) : void
@string string
includeLength bool /// to write the current length to the stream; otherwise, /// . ///
Результат void

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

Writes a ushort in big endian encoding to the current position in the stream and advances the position within the stream by two bytes.
public SendUInt16BE ( ushort value ) : void
value ushort /// The to write to the stream. ///
Результат void

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

Writes a uint in big endian encoding to the current position in the stream and advances the position within the stream by four bytes.
public SendUInt32BE ( uint value ) : void
value uint /// The to write to the stream. ///
Результат void

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

Writes a Version in big endian encoding to the current position in the stream.
public SendVersion ( System.Version version ) : void
version System.Version /// The to write to the stream. ///
Результат void

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

Initializes a new instance of the VncStream class.
public VncStream ( ) : System
Результат System