NativeBytes
Namespace Mc.Scripting · Kind struct (readonly, ref)
public readonly ref struct NativeBytesBorrowed byte buffer (McBytes). Only valid during the dispatch that provided it.
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
NativeBytes(byte* data, long size) |
Wraps native memory. |
Constructor
Section titled “Constructor”public NativeBytes(byte* data, long size)Wraps native memory.
Parameters
| Name | Type | Description |
|---|---|---|
data |
byte* |
|
size |
long |
Properties
Section titled “Properties”| Member | Description |
|---|---|
int Length { get; } |
Length in bytes. |
ReadOnlySpan<byte> Span { get; } |
The bytes (borrowed). |
Length
Section titled “Length”public int Length { get; }Length in bytes.
public ReadOnlySpan<byte> Span { get; }The bytes (borrowed).
Methods
Section titled “Methods”| Member | Description |
|---|---|
byte[] ToArray() |
Copies the bytes. |
ToArray
Section titled “ToArray”public byte[] ToArray()Copies the bytes.
Returns byte[]