SliceResult class
A contiguous area of native memory, which stays alive at least as long as this object.
SliceResults are expected to be immutable after they have been returned as a result.
On the nativ side, results which are typed as a slice and may have no value,
represent this with the null slice. In Dart, these results are typed as
nullable and are represented with null
.
- Inheritance
- Available Extensions
Constructors
- SliceResult(int size)
-
Creates an uninitialized SliceResult of
size
. - SliceResult.fromSlice(Slice slice)
-
Creates a SliceResult and copies the data from
slice
into it. - SliceResult.fromString(String string)
-
Creates a SliceResult which contains
string
encoded as UTF-8.factory - SliceResult.fromTypedList(Uint8List list)
-
Returns a SliceResult which has the content and size of
list
.factory
Properties
-
buf
→ Pointer<
Uint8> -
The pointer to start of this slice in native memory.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
The size of this slice in bytes.
finalinherited
Methods
-
asTypedList(
) → Uint8List -
Returns a Uint8List that is a mutable view of this Slice.
override
-
compareTo(
Slice other) → int -
Compares this slice lexicographically to
other
.inherited -
flSlice(
[Allocator allocator = malloc]) → Pointer< FLSlice> -
Allocates a FLSlice sets it to this slice.
inherited
-
flSliceResult(
[Allocator allocator = malloc]) → Pointer< FLSliceResult> - Allocates a FLSliceResult sets it to this slice.
-
makeGlobal(
) → Pointer< FLSlice> -
Sets the globalFLSlice to this slice and returns it.
inherited
-
makeGlobalResult(
) → Pointer< FLSliceResult> - Sets the globalFLSliceResult to this slice and returns it.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDartString(
) → String -
Interprets the data of this slice as an UTF-8 encoded string.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
toTypedList(
) → Uint8List -
Copies the contents of this Slice into a new Uint8List and returns it.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromFLSlice(
FLSlice slice) → SliceResult? -
Creates a SliceResult from a FLSlice by copying its content.
override
-
fromFLSliceResult(
FLSliceResult slice, {bool retain = false}) → SliceResult? - Creates a SliceResult from FLSliceResult.