C# Class RemoteViewing.Vnc.VncStream

Provides methods for reading and sending VNC data over a Stream.
Exibir arquivo Open project: qmfrederik/remoteviewing Class Usage Examples

Public Methods

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

Method Details

Close() public method

Closes the current stream and releases any resources associated with the current stream.
public Close ( ) : void
return void

DecodeString() public static method

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. ///
return string

EncodeString() public static method

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

EncodeString() public static method

Encodes all the characters in the specified string into a sequence of bytes.
public static EncodeString ( string @string ) : byte[]
@string string
return byte[]

Receive() public method

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

Receive() public method

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

ReceiveByte() public method

Reads a byte from the stream and advances the position within the stream by one byte.
public ReceiveByte ( ) : byte
return byte

ReceiveRectangle() public method

Reads a VncRectangle from the stream and advances the position within the stream by 8 bytes.
public ReceiveRectangle ( ) : VncRectangle
return VncRectangle

ReceiveString() public method

Reads a string from the stream.
public ReceiveString ( int maxLength = 0xfff ) : string
maxLength int /// The maximum length of the to /// read. ///
return string

ReceiveUInt16BE() public method

Reads a ushort in big-endian encoding from the stream and advances the position within the stream by two bytes.
public ReceiveUInt16BE ( ) : ushort
return ushort

ReceiveUInt32BE() public method

Reads a uint in big-endian encoding from the stream and advances the position within the stream by two bytes.
public ReceiveUInt32BE ( ) : uint
return uint

ReceiveVersion() public method

Receives version information from the stream.
public ReceiveVersion ( ) : System.Version
return System.Version

Require() public static method

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

SanityCheck() public static method

Throws a VncException if a specific condition is not met.
public static SanityCheck ( bool condition ) : void
condition bool /// The condition which should be met. ///
return void

Send() public method

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

Send() public method

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

SendByte() public method

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

SendRectangle() public method

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

SendString() public method

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

SendUInt16BE() public method

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

SendUInt32BE() public method

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

SendVersion() public method

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

VncStream() public method

Initializes a new instance of the VncStream class.
public VncStream ( ) : System
return System