canonical / canonical/stdlibc.dart

read & write use signed bytes

Open
#159 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
58
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Hey!

For me it was counter-intuitive to discover that the posix unistd functions, e.g. `read` and `write` use signed 8-bit values, instead of unsigned.

The rest of dart seems to use unsigned 0-255 values as bytes, e.g.: https://api.dart.dev/dart-io/File/writeAsBytes.html or the codecs in https://api.flutter.dev/flutter/dart-convert/

Is that intentional? If it is, I think it might be worth adding notes about that in the docs, or providing uint8 variants

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.