Home | History | Annotate | Download | only in charset

Lines Matching refs:replacement

96  * replacement byte array.  The replacement
99 * is initially set to the encoder's default replacement, which often
144 private byte[] replacement;
165 * bytes-per-char and replacement values.
178 * @param replacement
179 * The initial replacement; must not be <tt>null</tt>, must have
190 byte[] replacement)
193 this(cs, averageBytesPerChar, maxBytesPerChar, replacement, false);
197 * This constructor is for subclasses to specify whether {@code replacement} can be used as it
201 CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement,
218 this.replacement = replacement;
222 // replaceWith(replacement);
224 replaceWith(replacement);
231 * bytes-per-char values and its replacement will be the
267 * Returns this encoder's replacement value.
269 * @return This encoder's current replacement,
272 public final byte[] replacement() {
277 return Arrays.copyOf(replacement, replacement.length);
282 * Changes this encoder's replacement value.
285 * method, passing the new replacement, after checking that the new
286 * replacement is acceptable. </p>
288 * @param newReplacement The replacement value
295 * The new replacement; must not be <tt>null</tt>, must have
308 throw new IllegalArgumentException("Null replacement");
311 throw new IllegalArgumentException("Empty replacement");
313 throw new IllegalArgumentException("Replacement too long");
319 throw new IllegalArgumentException("Illegal replacement");
320 this.replacement = Arrays.copyOf(newReplacement, newReplacement.length);
322 implReplaceWith(this.replacement);
327 * Reports a change to this encoder's replacement value.
331 * the replacement. </p>
333 * @param newReplacement The replacement value
343 * Tells whether or not the given byte array is a legal replacement value
346 * <p> A replacement is legal if, and only if, it is a legal sequence of
348 * the replacement into one or more sixteen-bit Unicode characters.
356 * is a legal replacement value for this encoder
629 if (out.remaining() < replacement.length)
631 out.put(replacement);