Skip to content

ByteString: provide ByteString-factory overload accepting unsigned bytes #389

Closed
@fzhinkin

Description

@fzhinkin

Currently, ByteString-factory accepts only signed bytes. Which is mildly annoying when it comes to writing code that initializes byte strings with some constants.

It would be nice to have an unsigned bytes overload.

// How it looks now
val magic = ByteString(0xcf.toByte(), 0xfa.toByte(), 0xed.toByte(), 0xfe.toByte())

// How should it look:
val magic = ByteString(0xcfu, 0xfau, 0xedu, 0xfeu)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions