let byte_of_size sz =
let rec mul_1024 n i =
if n > 0 then
mul_1024
(n - 1)
(Int64.mul 1024L i)
else
i
in
match sz with
| B i -> i
| KB i -> mul_1024 1 i
| MB i -> mul_1024 2 i
| GB i -> mul_1024 3 i
| TB i -> mul_1024 4 i