C#C
C#3y ago
zylog

✅ [[QUESTION]] HOW TO CALCULATE THE Rent(int) property for System.Buffers.ArrayPool<byte> ?

Hey,
I have a question about System.Buffers.ArrayPool<byte>
I tried to read the document many times but I didn't get it.
what is the Rent(int) property of System.Buffers.ArrayPool<byte> ?

How do I know how many bytes I need for the buffer?
If I need a string of 5 characters, Rent(5) is enough ... I know that and it works.
but what if I need :
1 - String(5 character)
2 - bool
3 - Int(1 digit ) (1-5)
4 - Int(1 digit ) (1-5)
5 - Int(1 digit ) (1-5)
6 - Int(1 digit ) (1-5)
How do I calculate the Rent value I need?
Was this page helpful?