Skip to content

Partial bytes do not exist #67

Description

@Rainmaker52

I'm trying to use this library to keep my code a bit more readable.

If I do this:

var memoryBuffer = MemoryPool<byte>.Shared.Rent((int) ByteSize.FromKibiBytes(128).Bytes);

I have to cast .Bytes to an integer, because the Bytes property is a double.
I can understand returning a double for almost anything. But seeing as "Bytes" in particular, is really the lowest addressable data type, there is no way to have "partial bytes". You would never be addressing "1.2 bytes".

I would therefore suggest changing the "Bytes" type to an uint or ulong (I really don't see negative bytes as a thing either, but I could be wrong there).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions