C# Class CqlSharp.Protocol.StreamExtensions

Extensions to the Stream class to read and write primitive values as used in the Binary Protocol
Mostra file Open project: reuzel/CqlSharp

Public Methods

Method Description
ReadByteArray ( this stream ) : byte[]

Reads a byte array.

ReadInet ( this stream ) : IPEndPoint

Reads an IP-Address and port

ReadInt ( this stream ) : int

Reads an int.

ReadShort ( this stream ) : ushort

Reads a short.

ReadShortByteArray ( this stream ) : byte[]

Reads a short byte array.

ReadString ( this stream ) : string

Reads a string.

ReadStringList ( this stream ) : string[]

Reads a list of strings

ReadStringMultimap ( this stream ) : string[]>.Dictionary

Reads a string multimap.

ReadUuid ( this stream ) : System.Guid

Reads a UUID/GUID.

WriteByteArray ( this stream, byte data ) : void

Writes a byte array.

WriteConsistency ( this stream, CqlConsistency consistency ) : void

Writes the consistency.

WriteInet ( this stream, IPEndPoint endpoint ) : void

Writes an IP address and port

WriteInt ( this stream, int data ) : void

Writes an int.

WriteLong ( this stream, long data ) : void

Writes an long.

WriteLongString ( this stream, string data ) : void

Writes a long string.

WriteShort ( this stream, ushort data ) : void

Writes a short.

WriteShortByteArray ( this stream, byte data ) : void

Writes a short byte array.

WriteString ( this stream, string data ) : void

Writes a string.

WriteStringList ( this stream, IList data ) : void

Writes a list of strings.

WriteStringMap ( this stream, string>.IDictionary dic ) : void

Writes a string map.

WriteUuid ( this stream, System.Guid guid ) : void

Writes a UUID/GUID.

Private Methods

Method Description
ReadBuffer ( this stream, byte buffer ) : void

Reads the buffer.

ReadBuffer ( this stream, byte buffer, int len ) : void

Reads the buffer up to a specified length

Method Details

ReadByteArray() public static method

Reads a byte array.
public static ReadByteArray ( this stream ) : byte[]
stream this The stream.
return byte[]

ReadInet() public static method

Reads an IP-Address and port
Unexpected end of stream
public static ReadInet ( this stream ) : IPEndPoint
stream this The stream.
return System.Net.IPEndPoint

ReadInt() public static method

Reads an int.
Unexpected end of stream reached
public static ReadInt ( this stream ) : int
stream this The stream.
return int

ReadShort() public static method

Reads a short.
Unexpected end of stream reached
public static ReadShort ( this stream ) : ushort
stream this The stream.
return ushort

ReadShortByteArray() public static method

Reads a short byte array.
public static ReadShortByteArray ( this stream ) : byte[]
stream this The stream.
return byte[]

ReadString() public static method

Reads a string.
public static ReadString ( this stream ) : string
stream this The stream.
return string

ReadStringList() public static method

Reads a list of strings
public static ReadStringList ( this stream ) : string[]
stream this The stream.
return string[]

ReadStringMultimap() public static method

Reads a string multimap.
public static ReadStringMultimap ( this stream ) : string[]>.Dictionary
stream this The stream.
return string[]>.Dictionary

ReadUuid() public static method

Reads a UUID/GUID.
public static ReadUuid ( this stream ) : System.Guid
stream this The stream.
return System.Guid

WriteByteArray() public static method

Writes a byte array.
public static WriteByteArray ( this stream, byte data ) : void
stream this The stream.
data byte The data.
return void

WriteConsistency() public static method

Writes the consistency.
public static WriteConsistency ( this stream, CqlConsistency consistency ) : void
stream this The stream.
consistency CqlConsistency The consistency.
return void

WriteInet() public static method

Writes an IP address and port
public static WriteInet ( this stream, IPEndPoint endpoint ) : void
stream this The stream.
endpoint System.Net.IPEndPoint The endpoint.
return void

WriteInt() public static method

Writes an int.
public static WriteInt ( this stream, int data ) : void
stream this The stream.
data int The data.
return void

WriteLong() public static method

Writes an long.
public static WriteLong ( this stream, long data ) : void
stream this The stream.
data long The data.
return void

WriteLongString() public static method

Writes a long string.
public static WriteLongString ( this stream, string data ) : void
stream this The stream.
data string The data.
return void

WriteShort() public static method

Writes a short.
public static WriteShort ( this stream, ushort data ) : void
stream this The stream.
data ushort The data.
return void

WriteShortByteArray() public static method

Writes a short byte array.
public static WriteShortByteArray ( this stream, byte data ) : void
stream this The stream.
data byte The data.
return void

WriteString() public static method

Writes a string.
public static WriteString ( this stream, string data ) : void
stream this The stream.
data string The data.
return void

WriteStringList() public static method

Writes a list of strings.
public static WriteStringList ( this stream, IList data ) : void
stream this The stream.
data IList The data.
return void

WriteStringMap() public static method

Writes a string map.
public static WriteStringMap ( this stream, string>.IDictionary dic ) : void
stream this The stream.
dic string>.IDictionary The dic.
return void

WriteUuid() public static method

Writes a UUID/GUID.
public static WriteUuid ( this stream, System.Guid guid ) : void
stream this The stream.
guid System.Guid The GUID.
return void