encodeBuffered
Encode a ByteArray using a buffer of maximum size DEFAULT_BUFFER_SIZE.
The encoding operation will allocate a single buffer, streaming encoded characters to it and flushing to action when needed. If the pre-calculated size returned by EncoderDecoder.Config.encodeOutMaxSize is less than or equal to the DEFAULT_BUFFER_SIZE, then a buffer of that size will be allocated and action is only invoked once (single-shot encoding). In the event that EncoderDecoder.Config.encodeOutMaxSize throws its EncodingSizeException (i.e. encoding would exceed Int.MAX_VALUE) while throwOnOverflow is false, or its return value is greater than DEFAULT_BUFFER_SIZE, then this function will always stream encode to a buffer while flushing to action until the encoding operation has completed.
NOTE: Documented exceptions thrown by this function do not include those for which action may throw.
NOTE: The Encoder implementation must be compatible with version 2.6.0+ APIs and define a EncoderDecoder.Config.maxEncodeEmit. If the value is -1 (i.e. it has not updated to the new API yet), then this function will fail with an EncodingException. All implementations provided by this library have been updated to meet the API requirement; only EncoderDecoder implementations external to this library that have not updated yet may fail when using them with encodeBuffered and encodeBufferedAsync APIs.
Return
The number of encoded characters.
Parameters
The Encoder to use.
If true and EncoderDecoder.Config.encodeOutMaxSize throws an EncodingSizeException, it will be re-thrown. If false, the exception is ignored and stream encoding to the buffer will continue.
The function to flush the buffer to; a destination to "write" encoded data to whereby len is the number of characters within buf, starting at index offset, to "write".
See also
Throws
If the encoder is configured to reject something, such as UTF-8 byte to text transformations rejecting invalid byte sequences.
If EncoderDecoder.Config.encodeOutMaxSize threw its exception (i.e. output would exceed Int.MAX_VALUE) and throwOnOverflow is true.
Encode len number of bytes from the array, starting at index offset, using a buffer of maximum size DEFAULT_BUFFER_SIZE.
The encoding operation will allocate a single buffer, streaming encoded characters to it and flushing to action when needed. If the pre-calculated size returned by EncoderDecoder.Config.encodeOutMaxSize is less than or equal to the DEFAULT_BUFFER_SIZE, then a buffer of that size will be allocated and action is only invoked once (single-shot encoding). In the event that EncoderDecoder.Config.encodeOutMaxSize throws its EncodingSizeException (i.e. encoding would exceed Int.MAX_VALUE) while throwOnOverflow is false, or its return value is greater than DEFAULT_BUFFER_SIZE, then this function will always stream encode to a buffer while flushing to action until the encoding operation has completed.
NOTE: Documented exceptions thrown by this function do not include those for which action may throw.
NOTE: The Encoder implementation must be compatible with version 2.6.0+ APIs and define a EncoderDecoder.Config.maxEncodeEmit. If the value is -1 (i.e. it has not updated to the new API yet), then this function will fail with an EncodingException. All implementations provided by this library have been updated to meet the API requirement; only EncoderDecoder implementations external to this library that have not updated yet may fail when using them with encodeBuffered and encodeBufferedAsync APIs.
Return
The number of encoded characters.
Parameters
The Encoder to use.
If true and EncoderDecoder.Config.encodeOutMaxSize throws an EncodingSizeException, it will be re-thrown. If false, the exception is ignored and stream encoding to the buffer will continue.
The index in the array to start at.
The number of bytes, starting at index offset.
The function to flush the buffer to; a destination to "write" encoded data to whereby len is the number of characters within buf, starting at index offset, to "write".
See also
Throws
If the encoder is configured to reject something, such as UTF-8 byte to text transformations rejecting invalid byte sequences.
If EncoderDecoder.Config.encodeOutMaxSize threw its exception (i.e. output would exceed Int.MAX_VALUE) and throwOnOverflow is true.
Encode a ByteArray using a buffer of maximum size maxBufSize.
The encoding operation will allocate a single buffer, streaming encoded characters to it and flushing to action when needed. If the pre-calculated size returned by EncoderDecoder.Config.encodeOutMaxSize is less than or equal to the maxBufSize, then a buffer of that size will be allocated and action is only invoked once (single-shot encoding). In the event that EncoderDecoder.Config.encodeOutMaxSize throws its EncodingSizeException (i.e. encoding would exceed Int.MAX_VALUE) while throwOnOverflow is false, or its return value is greater than maxBufSize, then this function will always stream encode to a buffer while flushing to action until the encoding operation has completed.
NOTE: Documented exceptions thrown by this function do not include those for which action may throw.
NOTE: The Encoder implementation must be compatible with version 2.6.0+ APIs and define a EncoderDecoder.Config.maxEncodeEmit. If the value is -1 (i.e. it has not updated to the new API yet), then this function will fail with an EncodingException. All implementations provided by this library have been updated to meet the API requirement; only EncoderDecoder implementations external to this library that have not updated yet may fail when using them with encodeBuffered and encodeBufferedAsync APIs.
Return
The number of encoded characters.
Parameters
The Encoder to use.
If true and EncoderDecoder.Config.encodeOutMaxSize throws an EncodingSizeException, it will be re-thrown. If false, the exception is ignored and stream encoding to the buffer will continue.
The maximum size buffer this function will allocate. Must be greater than EncoderDecoder.Config.maxEncodeEmitWithLineBreak.
The function to flush the buffer to; a destination to "write" encoded data to whereby len is the number of characters within buf, starting at index offset, to "write".
See also
Throws
If the encoder is configured to reject something, such as UTF-8 byte to text transformations rejecting invalid byte sequences.
If EncoderDecoder.Config.encodeOutMaxSize threw its exception (i.e. output would exceed Int.MAX_VALUE) and throwOnOverflow is true.
If maxBufSize is less than or equal to EncoderDecoder.Config.maxEncodeEmitWithLineBreak.
Encode len number of bytes from the array, starting at index offset, using a buffer of maximum size maxBufSize.
The encoding operation will allocate a single buffer, streaming encoded characters to it and flushing to action when needed. If the pre-calculated size returned by EncoderDecoder.Config.encodeOutMaxSize is less than or equal to the maxBufSize, then a buffer of that size will be allocated and action is only invoked once (single-shot encoding). In the event that EncoderDecoder.Config.encodeOutMaxSize throws its EncodingSizeException (i.e. encoding would exceed Int.MAX_VALUE) while throwOnOverflow is false, or its return value is greater than maxBufSize, then this function will always stream encode to a buffer while flushing to action until the encoding operation has completed.
NOTE: Documented exceptions thrown by this function do not include those for which action may throw.
NOTE: The Encoder implementation must be compatible with version 2.6.0+ APIs and define a EncoderDecoder.Config.maxEncodeEmit. If the value is -1 (i.e. it has not updated to the new API yet), then this function will fail with an EncodingException. All implementations provided by this library have been updated to meet the API requirement; only EncoderDecoder implementations external to this library that have not updated yet may fail when using them with encodeBuffered and encodeBufferedAsync APIs.
Return
The number of encoded characters.
Parameters
The Encoder to use.
If true and EncoderDecoder.Config.encodeOutMaxSize throws an EncodingSizeException, it will be re-thrown. If false, the exception is ignored and stream encoding to the buffer will continue.
The index in the array to start at.
The number of bytes, starting at index offset.
The maximum size buffer this function will allocate. Must be greater than EncoderDecoder.Config.maxEncodeEmitWithLineBreak.
The function to flush the buffer to; a destination to "write" encoded data to whereby len is the number of characters within buf, starting at index offset, to "write".
See also
Throws
If the encoder is configured to reject something, such as UTF-8 byte to text transformations rejecting invalid byte sequences.
If EncoderDecoder.Config.encodeOutMaxSize threw its exception (i.e. output would exceed Int.MAX_VALUE) and throwOnOverflow is true.
If maxBufSize is less than or equal to EncoderDecoder.Config.maxEncodeEmitWithLineBreak.
Encode a ByteArray using the provided pre-allocated, reusable, buf array.
The encoding operation will stream encoded characters to the provided buf, flushing to action when needed. If the pre-calculated size returned by EncoderDecoder.Config.encodeOutMaxSize is less than or equal to the buf size, then action is only invoked once (single-shot encoding). In the event that EncoderDecoder.Config.encodeOutMaxSize throws its EncodingSizeException (i.e. encoding would exceed Int.MAX_VALUE) while throwOnOverflow is false, or its return value is greater than buf size, then this function will always stream encode to a buffer while flushing to action until the encoding operation has completed.
NOTE: Documented exceptions thrown by this function do not include those for which action may throw.
NOTE: If EncoderDecoder.Config.backFillBuffers is true, provided buf array will be back-filled with null character \u0000 upon encoding completion.
NOTE: The Encoder implementation must be compatible with version 2.6.0+ APIs and define a EncoderDecoder.Config.maxEncodeEmit. If the value is -1 (i.e. it has not updated to the new API yet), then this function will fail with an EncodingException. All implementations provided by this library have been updated to meet the API requirement; only EncoderDecoder implementations external to this library that have not updated yet may fail when using them with encodeBuffered and encodeBufferedAsync APIs.
Return
The number of encoded characters.
Parameters
The Encoder to use.
If true and EncoderDecoder.Config.encodeOutMaxSize throws an EncodingSizeException, it will be re-thrown. If false, the exception is ignored and stream encoding to the buffer will continue.
The pre-allocated array to use as the buffer. Its size must be greater than EncoderDecoder.Config.maxEncodeEmitWithLineBreak.
The function to flush the buffer to; a destination to "write" encoded data to whereby len is the number of characters within buf, starting at index offset, to "write".
See also
Throws
If the encoder is configured to reject something, such as UTF-8 byte to text transformations rejecting invalid byte sequences.
If EncoderDecoder.Config.encodeOutMaxSize threw its exception (i.e. output would exceed Int.MAX_VALUE) and throwOnOverflow is true.
If buf size is less than or equal to EncoderDecoder.Config.maxEncodeEmitWithLineBreak.
Encode len number of bytes from the array, starting at index offset, using the provided pre-allocated, reusable, buf array.
The encoding operation will stream encoded characters to the provided buf, flushing to action when needed. If the pre-calculated size returned by EncoderDecoder.Config.encodeOutMaxSize is less than or equal to the buf size, then action is only invoked once (single-shot encoding). In the event that EncoderDecoder.Config.encodeOutMaxSize throws its EncodingSizeException (i.e. encoding would exceed Int.MAX_VALUE) while throwOnOverflow is false, or its return value is greater than buf size, then this function will always stream encode to a buffer while flushing to action until the encoding operation has completed.
NOTE: Documented exceptions thrown by this function do not include those for which action may throw.
NOTE: If EncoderDecoder.Config.backFillBuffers is true, provided buf array will be back-filled with null character \u0000 upon encoding completion.
NOTE: The Encoder implementation must be compatible with version 2.6.0+ APIs and define a EncoderDecoder.Config.maxEncodeEmit. If the value is -1 (i.e. it has not updated to the new API yet), then this function will fail with an EncodingException. All implementations provided by this library have been updated to meet the API requirement; only EncoderDecoder implementations external to this library that have not updated yet may fail when using them with encodeBuffered and encodeBufferedAsync APIs.
Return
The number of encoded characters.
Parameters
The Encoder to use.
If true and EncoderDecoder.Config.encodeOutMaxSize throws an EncodingSizeException, it will be re-thrown. If false, the exception is ignored and stream encoding to the buffer will continue.
The index in the array to start at.
The number of bytes, starting at index offset.
The pre-allocated array to use as the buffer. Its size must be greater than EncoderDecoder.Config.maxEncodeEmitWithLineBreak.
The function to flush the buffer to; a destination to "write" encoded data to whereby len is the number of characters within buf, starting at index offset, to "write".
See also
Throws
If the encoder is configured to reject something, such as UTF-8 byte to text transformations rejecting invalid byte sequences.
If EncoderDecoder.Config.encodeOutMaxSize threw its exception (i.e. output would exceed Int.MAX_VALUE) and throwOnOverflow is true.
If buf size is less than or equal to EncoderDecoder.Config.maxEncodeEmitWithLineBreak.