Table of Contents

Method TryReserve

Namespace
MailFathom.Application.Emails.AttachmentText
Assembly
MailFathom.Application.dll

TryReserve(long)

Takes the octets one attachment would cost, when the pass can still afford them.

public bool TryReserve(long octets)

Parameters

octets long

What reading the attachment would read.

Returns

bool

true when the budget was charged; false when it could not be.

Remarks

Reserved before the read rather than counted after it, so an attachment is never opened on a budget that could not have paid for it. An attachment larger than the whole remaining budget is refused rather than admitted for being the first one asked, which is what keeps the ceiling a ceiling.

Exceptions

ArgumentOutOfRangeException

Thrown when octets is negative.