Rez
2016-10-17 15:21:08 UTC
I am currently writing a loader for a binary format. The format is
chunk-based. I'm stuck at reading numeric array types. I'm using typed data
views to access the chunk content based on their type. The problem I found
is that I can't use arbitrary offset for typed data views; the offset must
be multiple of the element size in bytes.
An example
here: https://dartpad.dartlang.org/24c8e870735d400f2f5b77d1d1d7a57a
1. Is there any work around, which works efficiently without unnecessary
copying?
2. A question for Dart team: why the offset must be multiple of the element
size? Isn't it actually unnecessary? I mean the offset has been checked
that must be 0 or positive (range check), same with the element accessor
index.
chunk-based. I'm stuck at reading numeric array types. I'm using typed data
views to access the chunk content based on their type. The problem I found
is that I can't use arbitrary offset for typed data views; the offset must
be multiple of the element size in bytes.
An example
here: https://dartpad.dartlang.org/24c8e870735d400f2f5b77d1d1d7a57a
1. Is there any work around, which works efficiently without unnecessary
copying?
2. A question for Dart team: why the offset must be multiple of the element
size? Isn't it actually unnecessary? I mean the offset has been checked
that must be 0 or positive (range check), same with the element accessor
index.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.