[#BloombergLP-bdlde-Base64Encoder-convert-05] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::xref:BloombergLP/bdlde/Base64Encoder.adoc[Base64Encoder]::convert :relfileprefix: ../../../ :mrdocs: Encode input bytes from `[begin, end)]` into Base64 with limits. == Synopsis Declared in `<bdlde_base64encoder.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class OUTPUT_ITERATOR, class INPUT_ITERATOR> int convert( OUTPUT_ITERATOR out, int* numOut, int* numIn, INPUT_ITERATOR begin, INPUT_ITERATOR end, int maxNumOut = ‐1); ---- == Description Encode the sequence of input characters starting at the specified `begin` position up to, but not including, the specified `end` position, writing any resulting output characters to the specified `out` buffer. Optionally specify the `maxNumOut` limit on the number of bytes to output; if `maxNumOut` is negative, no limit is imposed. If the `maxNumOut` limit is reached, no further input will be consumed. Load into the (optionally) specified `numOut` and `numIn` the number of output bytes produced and input bytes consumed, respectively. Return a non‐negative value on success and a negative value otherwise. A positive return status indicates the number of valid processed output bytes retained by this encoder and not written to `out` because `maxNumOut` has been reached; these bytes are available for output if this method is called with appropriate input. Note that calling this method after `endConvert` has been invoked without an intervening `resetState` call will place this instance in an error state, and return an error status. Note also that it is recommended that after all calls to `convert` are finished, the `endConvert` method be called to complete the encoding of any unprocessed input characters that do not complete a 3‐byte sequence. == Return Value a non‐negative value on success (positive means retained output bytes not yet written), and a negative value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *out* | output iterator for encoded characters | *numOut* | optionally receives the number of output bytes produced | *numIn* | optionally receives the number of input bytes consumed | *begin* | beginning of the input byte range | *end* | end of the input byte range (one past the last byte) | *maxNumOut* | maximum output bytes to emit; negative means no limit |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#