Config
Base configuration for an EncoderDecoder. More options may be specified by the implementation.
Constructors
Types
Properties
When the functions Encoder.encodeToString, Encoder.encodeToCharArray, Encoder.encodeBuffered, Encoder.encodeBufferedAsync, Decoder.decodeBuffered, and Decoder.decodeBufferedAsync are utilized, they may allocate an appropriate medium (a buffer) to store encoded/decoded data (e.g. a StringBuilder, CharArray, or ByteArray). Depending on the underlying operation, such as an array over-allocation due to encodeOutMaxSize or decodeOutMaxSize, those initially allocated buffers may not be returned as the function's result. Prior versions of this library always back-filled them with 0 or the null character \u0000, but that can be computationally expensive for large datasets and potentially unnecessary if data is known to not be sensitive in nature.
If true, the characters ('\n', '\r', ' ', '\t') will be skipped over (i.e. allowed but ignored) during decoding operations. If false, a MalformedEncodingException will be thrown when those characters are encountered. If null, those characters are passed along to the Decoder.Feed implementation as input.
If greater than 0, Encoder.newEncoderFeed may use a LineBreakOutFeed such that for every lineBreakInterval number of encoded characters output by the Encoder.Feed, the next encoded character output will be preceded with a new line character \n.
If and only if Encoder.newEncoderFeed wraps the Encoder.OutFeed passed to it with a LineBreakOutFeed, will this setting then be used for the LineBreakOutFeed.resetOnFlush parameter. If true and Encoder.newEncoderFeed wrapped its provided Encoder.OutFeed, then LineBreakOutFeed.reset will be called after every invocation of Encoder.Feed.flush.
The maximum number of bytes that the implementation's Decoder.Feed can potentially emit on a single invocation of Decoder.Feed.consume, Decoder.Feed.flush, or Decoder.Feed.doFinal.
The maximum number of characters that the implementation's Encoder.Feed can potentially emit on a single invocation of Encoder.Feed.consume, Encoder.Feed.flush, or Encoder.Feed.doFinal.
The maximum number of characters that the Encoder.Feed produced by Encoder.newEncoderFeed can potentially emit on a single invocation of Encoder.Feed.consume, Encoder.Feed.flush, or Encoder.Feed.doFinal. This is the calculated result from Companion.calculateMaxEncodeEmit using maxEncodeEmit and lineBreakInterval as arguments.
The character that is used when padding encoded output. This is used by Decoder.Feed to mark input as "completing" such that further non-padding input can be exceptionally rejected with a MalformedEncodingException. If the encoding specification does not use padding, null may be specified.
Functions
Pre-calculates and returns the maximum size of the output, after decoding would occur, for input that is not yet known (i.e. cannot be wrapped in DecoderInput, such as the contents of a File where only the file size is known) based off of the Config options set for the implementation.
Pre-calculates and returns the maximum size of the output, after decoding would occur, for input that is known based off of the Config options set for the implementation.
Calculate and return a maximum size that a decoding would be for the encodedSize data.
Calculate and return a maximum size that a decoding would be for the encodedSize data.
Pre-calculates and returns the maximum size of the output, after encoding would occur, based off the Config options set for the implementation. Most implementations, such as Base16, Base32, and Base64, are able to return an exact size whereby no post-encoding resize is necessary, while others, such as UTF-8 byte to text transformations, return a maximum and may require a post-encoding resize.
Calculate and return an exact (preferably), or maximum, size that an encoding would be for the unEncodedSize data.