Class BncsReader
Completes a DataBuffer implementation with the additional data used by the BNCS protocol.
Inherited Members
Namespace: MBNCSUtil
Assembly: MBNCSUtil.dll
Syntax
public class BncsReader : DataReader
Remarks
When using this class with a Stream, the BncsReader only takes the next packet's data off of the stream. An ideal example of this would be when using a System.Net.Sockets.NetworkStream to connect to Battle.net. Incidentally, this constructor and method will block execution until new data has arrived. Therefore, if your main receiving loop is going to use these methods, it should be on a background worker loop.
Constructors
| Improve this Doc View SourceBncsReader(Byte[])
Creates a new data reader with the specified byte data.
Declaration
public BncsReader(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data to read. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if data is null (Nothing in Visual Basic). |
BncsReader(Stream)
Creates a new data reader with the specified stream as input.
Declaration
public BncsReader(Stream str)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | str | The stream from which to read. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if str is null (Nothing in Visual Basic). |
Properties
| Improve this Doc View SourceLength
Gets the length of the data.
Declaration
public override int Length { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | Thrown if this reader is not yet initialized. |
PacketID
Gets or sets the ID of the packet as it was specified when it was created.
Declaration
public byte PacketID { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
Methods
| Improve this Doc View SourceToString()
Gets a hex representation of this data.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representing this buffer's contents in hexadecimal notation. |