textBufferWriteUtf8Chunk method
Appends textLen caller-owned persistent UTF-8 textBytes to
textBuffer with fg/bg colors and packed attributes, returning the
native write result. Throws FFIException on failure.
Implementation
int textBufferWriteUtf8Chunk(
Pointer<TextBufferHandle> textBuffer,
Pointer<Uint8> textBytes,
int textLen,
Color fg,
Color bg,
int attributes,
) => _guardAlloc('Failed to write text buffer UTF-8 chunk', (alloc) {
final attrPtr = alloc<Uint8>();
attrPtr[0] = attributes;
return _generated.textBufferWriteChunk(
textBuffer.cast(),
textBytes,
textLen,
fg.toNative(alloc),
bg.toNative(alloc),
attrPtr,
);
});