NativeUtf8StringEncoder class
A UTF-8 encoder that directly writes to external memory.
This is more efficient than encoding to Dart memory first and than copying to external memory.
Constructors
- NativeUtf8StringEncoder()
-
Creates a UTF-8 encoder that directly writes to external memory.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
encode(
String string, Allocator allocator, [int start = 0, int? end]) → NativeUtf8String -
Encodes
string
into a NativeUtf8String, after allocating the required external memory. -
encodedAllocationSize(
String string) → int - Returns the number of bytes required to encode the given string.
-
encodeToBuffer(
String string, Pointer< Uint8> buffer, {required int allocationSize, int start = 0, required int end, Allocator? allocator}) → NativeUtf8String -
Encodes
string
into a NativeUtf8String, writing to a pre-allocated external memorybuffer
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited