Class BEncodedValue
Base interface for all BEncoded values.
Inheritance
System.Object
BEncodedValue
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: MonoTorrent.dll
Syntax
public abstract class BEncodedValue
Methods
Clone<T>(T)
Declaration
public static T Clone<T>(T value)
where T : BEncodedValue
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Type Parameters
Decode(RawReader)
Decode BEncoded data in the given RawReader
Declaration
public static BEncodedValue Decode(RawReader reader)
Parameters
| Type |
Name |
Description |
| RawReader |
reader |
The RawReader containing the BEncoded data
|
Returns
| Type |
Description |
| BEncodedValue |
BEncodedValue containing the data that was in the stream
|
Decode(Byte[])
Interface for all BEncoded values
Declaration
public static BEncodedValue Decode(byte[] data)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
data |
The byte array containing the BEncoded data
|
Returns
Decode(Byte[], Int32, Int32)
Decode BEncoded data in the given byte array
Declaration
public static BEncodedValue Decode(byte[] buffer, int offset, int length)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
buffer |
The byte array containing the BEncoded data
|
| System.Int32 |
offset |
The offset at which the data starts at
|
| System.Int32 |
length |
The number of bytes to be decoded
|
Returns
| Type |
Description |
| BEncodedValue |
BEncodedValue containing the data that was in the byte[]
|
Decode(Byte[], Int32, Int32, Boolean)
Declaration
public static BEncodedValue Decode(byte[] buffer, int offset, int length, bool strictDecoding)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
buffer |
|
| System.Int32 |
offset |
|
| System.Int32 |
length |
|
| System.Boolean |
strictDecoding |
|
Returns
Decode(Stream)
Decode BEncoded data in the given stream
Declaration
public static BEncodedValue Decode(Stream stream)
Parameters
| Type |
Name |
Description |
| System.IO.Stream |
stream |
The stream containing the BEncoded data
|
Returns
| Type |
Description |
| BEncodedValue |
BEncodedValue containing the data that was in the stream
|
Decode<T>(RawReader)
Declaration
public static T Decode<T>(RawReader reader)
where T : BEncodedValue
Parameters
Returns
Type Parameters
Decode<T>(Byte[])
Interface for all BEncoded values
Declaration
public static T Decode<T>(byte[] data)
where T : BEncodedValue
Parameters
| Type |
Name |
Description |
| System.Byte[] |
data |
The byte array containing the BEncoded data
|
Returns
Type Parameters
Decode<T>(Byte[], Int32, Int32)
Decode BEncoded data in the given byte array
Declaration
public static T Decode<T>(byte[] buffer, int offset, int length)
where T : BEncodedValue
Parameters
| Type |
Name |
Description |
| System.Byte[] |
buffer |
The byte array containing the BEncoded data
|
| System.Int32 |
offset |
The offset at which the data starts at
|
| System.Int32 |
length |
The number of bytes to be decoded
|
Returns
| Type |
Description |
| T |
BEncodedValue containing the data that was in the byte[]
|
Type Parameters
Decode<T>(Byte[], Int32, Int32, Boolean)
Declaration
public static T Decode<T>(byte[] buffer, int offset, int length, bool strictDecoding)
where T : BEncodedValue
Parameters
| Type |
Name |
Description |
| System.Byte[] |
buffer |
|
| System.Int32 |
offset |
|
| System.Int32 |
length |
|
| System.Boolean |
strictDecoding |
|
Returns
Type Parameters
Decode<T>(Stream)
Decode BEncoded data in the given stream
Declaration
public static T Decode<T>(Stream stream)
where T : BEncodedValue
Parameters
| Type |
Name |
Description |
| System.IO.Stream |
stream |
The stream containing the BEncoded data
|
Returns
| Type |
Description |
| T |
BEncodedValue containing the data that was in the stream
|
Type Parameters
Encode()
Encodes the BEncodedValue into a byte array
Declaration
Returns
| Type |
Description |
| System.Byte[] |
Byte array containing the BEncoded Data
|
Encode(Byte[], Int32)
Encodes the BEncodedValue into the supplied buffer
Declaration
public abstract int Encode(byte[] buffer, int offset)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
buffer |
The buffer to encode the information to
|
| System.Int32 |
offset |
The offset in the buffer to start writing the data
|
Returns
| Type |
Description |
| System.Int32 |
|
LengthInBytes()
Returns the size of the byte[] needed to encode this BEncodedValue
Declaration
public abstract int LengthInBytes()
Returns
| Type |
Description |
| System.Int32 |
|