-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b53
-
generic
-
generic
CharsetEncoder provides an implementation of isLegalReplacement,
but it is not very efficient.
* <p> The default implementation of this method is not very efficient; it
* should generally be overridden to improve performance. </p>
*
*/
public boolean isLegalReplacement(byte[] repl) {
The intent was likely that JDK-provided Encoders would implement this,
but it has not happened.
This is particularly important because creation of an Encoder causes an
entire decoding operation to be performed, which makes creation of Encoders
much more expensive than creation of Decoders.
For a number of Encoders, the implementation is a trivial { return true; }
but it is not very efficient.
* <p> The default implementation of this method is not very efficient; it
* should generally be overridden to improve performance. </p>
*
*/
public boolean isLegalReplacement(byte[] repl) {
The intent was likely that JDK-provided Encoders would implement this,
but it has not happened.
This is particularly important because creation of an Encoder causes an
entire decoding operation to be performed, which makes creation of Encoders
much more expensive than creation of Decoders.
For a number of Encoders, the implementation is a trivial { return true; }