Skip to content

Commit

Permalink
Provide byteSize method on Bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Nov 26, 2023
1 parent c8744fa commit 3294627
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/bytesize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ extension (bs: Long)
def mb: ByteSize = ByteSize(bs*1024*1024)
def gb: ByteSize = ByteSize(bs*1024*1024*1024)
def tb: ByteSize = ByteSize(bs*1024*1024*1024*1024)

extension (bytes: Bytes)
def byteSize: ByteSize = ByteSize(bytes.size)

0 comments on commit 3294627

Please sign in to comment.