Interface IBinaryFormattable<TSelf>
Represents an object that can be converted to and restored from the binary representation.
Namespace: DotNext.Buffers.Binary
Assembly: DotNext.dll
Syntax
public interface IBinaryFormattable<out TSelf> where TSelf : IBinaryFormattable<out TSelf>, allows ref struct
Type Parameters
| Name | Description |
|---|---|
| TSelf | The implementing type. |
Properties
View SourceSize
Gets size of the object, in bytes.
Declaration
public static abstract int Size { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceFormat(scoped Span<byte>)
Formats object as a sequence of bytes.
Declaration
void Format(scoped Span<byte> destination)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<byte> | destination | The output buffer. |
Parse(scoped ReadOnlySpan<byte>)
Restores the object from its binary representation.
Declaration
public static abstract TSelf Parse(scoped ReadOnlySpan<byte> source)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<byte> | source | The input buffer. |
Returns
| Type | Description |
|---|---|
| TSelf | The restored object. |