Make non-native endianness access easier. #49020
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-typed-data
type-enhancement
A request for a change that isn't a bug
I want to perform a complex task with library "typed_data". But unfortunately I have to choose ineffective ways at every step.
Unfortunately you have to use a loop to set an typed data array to
ByteData
:If you don't want to use loop, you have a option for writing to
ByteData
:This option is quite efficient compared to using a loop. We are still copying the byteData on the write operation. There's really no need for this.
BUT, this solution does not seem possible. Because it is not possible to give endianess to methods and the methods use different endian in my example.
Solution
To TypedData
Add method
bufferWith(Endian)
.So, for example, we can create a ByteBuffer with given endian from a Uint32List.
I may not know exactly how it works in native. Maybe this parameter should be added to
ByteBuffer.as*List
functions instead.ByteData
Add
set*List(int offset, TypedData value, [Endian endian = default])
andget*List(int offset, int lengthInBytes, [Endian endian = default])
Thanks!
The text was updated successfully, but these errors were encountered: