Class UserData
Odin UserData helper for marshal byte arrays
Implements:
OdinNative.Wrapper.IUserData
Properties
Encoding
Default Encoding
Buffer
Raw UserData
Methods
CopyFrom(nint, ulong)
Copies data from memory to Buffer
Parameters
| Type | Name | Description |
|---|---|---|
System.IntPtr | ptr | source |
System.UInt64 | size | Buffer size |
IsEmpty()
Indicates whether data is null or empty
Returns
System.Boolean: true if empty
Contains(string)
Indicates whether substring occurs
Returns
System.Boolean: true if contain
Parameters
| Type | Name |
|---|---|
System.String | value |
Contains(byte)
Indicates whether element occurs
Returns
System.Boolean: true if contain
Parameters
| Type | Name | Description |
|---|---|---|
System.Byte | value | byte |
PatternAt(byte[])
Finds all occurrences of the byte sequence in the buffer
Returns
System.Collections.Generic.IEnumerable<System.Int32>: indices of all occurrences of the pattern
Parameters
| Type | Name | Description |
|---|---|---|
System.Byte[] | pattern | byte sequence |
Clone()
Creates a shallow copy of the Buffer
Returns
OdinNative.Wrapper.UserData: new instance
ToBytes()
Used for converting Data on network level
Returns
System.Byte[]: arbitrary data
ToJson()
Json representation of raw byte buffer
Returns
System.String: json representation
ToString()
String representation of Buffer based on the specified encoding
Returns
System.String: string representation
ToType<T>()
Type deserialization of json string buffer content
Returns
<T>: T instance
Type Parameters
| Name | Description |
|---|---|
T | not an abstract or interface type |