/** * Sets this decoder's action on malformed input errors. * * This method will call the * {@link #implOnMalformedInput(CodingErrorAction) implOnMalformedInput} * method with the given new action as argument. * * @param newAction * the new action on malformed input error. * @return this decoder. * @throws IllegalArgumentException * if {@code newAction == null}. */ public final CharsetDecoder onMalformedInput(CodingErrorAction newAction) { if (newAction == null) { throw new IllegalArgumentException("newAction == null"); } malformedInputAction = newAction; implOnMalformedInput(newAction); return this; }
StandardCharsets.UTF_8 .newDecoder() .implOnMalformedInput(CodingErrorAction.REPORT) .implOnUnmappableCharacter(CodingErrorAction.REPLACE) .implReplaceWith(replacementString) .decode(ByteBuffer.wrap(byteArray)) .toString();
/** * Sets this decoder's action on malformed input errors. * * This method will call the * {@link #implOnMalformedInput(CodingErrorAction) implOnMalformedInput} * method with the given new action as argument. * * @param newAction * the new action on malformed input error. * @return this decoder. * @throws IllegalArgumentException * if {@code newAction == null}. */ public final CharsetDecoder onMalformedInput(CodingErrorAction newAction) { if (newAction == null) { throw new IllegalArgumentException("newAction == null"); } malformedInputAction = newAction; implOnMalformedInput(newAction); return this; }
/** * Sets this decoder's action on malformed input errors. * * This method will call the * {@link #implOnMalformedInput(CodingErrorAction) implOnMalformedInput} * method with the given new action as argument. * * @param newAction * the new action on malformed input error. * @return this decoder. * @throws IllegalArgumentException * if {@code newAction == null}. */ public final CharsetDecoder onMalformedInput(CodingErrorAction newAction) { if (newAction == null) { throw new IllegalArgumentException("newAction == null"); } malformedInputAction = newAction; implOnMalformedInput(newAction); return this; }
/** * Sets this decoder's action on malformed input errors. * * This method will call the * {@link #implOnMalformedInput(CodingErrorAction) implOnMalformedInput} * method with the given new action as argument. * * @param newAction * the new action on malformed input error. * @return this decoder. * @throws IllegalArgumentException * if {@code newAction == null}. */ public final CharsetDecoder onMalformedInput(CodingErrorAction newAction) { if (newAction == null) { throw new IllegalArgumentException("newAction == null"); } malformedInputAction = newAction; implOnMalformedInput(newAction); return this; }
/** * Sets this decoder's action on malformed input errors. * * This method will call the * {@link #implOnMalformedInput(CodingErrorAction) implOnMalformedInput} * method with the given new action as argument. * * @param newAction * the new action on malformed input error. * @return this decoder. * @throws IllegalArgumentException * if {@code newAction == null}. */ public final CharsetDecoder onMalformedInput(CodingErrorAction newAction) { if (newAction == null) { throw new IllegalArgumentException("newAction == null"); } malformedInputAction = newAction; implOnMalformedInput(newAction); return this; }
/** * Sets this decoder's action on malformed input errors. * * This method will call the * {@link #implOnMalformedInput(CodingErrorAction) implOnMalformedInput} * method with the given new action as argument. * * @param newAction * the new action on malformed input error. * @return this decoder. * @throws IllegalArgumentException * if {@code newAction == null}. */ public final CharsetDecoder onMalformedInput(CodingErrorAction newAction) { if (newAction == null) { throw new IllegalArgumentException("newAction == null"); } malformedInputAction = newAction; implOnMalformedInput(newAction); return this; }
/** * Sets this decoder's action on malformed input errors. * * This method will call the * {@link #implOnMalformedInput(CodingErrorAction) implOnMalformedInput} * method with the given new action as argument. * * @param newAction * the new action on malformed input error. * @return this decoder. * @throws IllegalArgumentException * if {@code newAction == null}. */ public final CharsetDecoder onMalformedInput(CodingErrorAction newAction) { if (newAction == null) { throw new IllegalArgumentException("newAction == null"); } malformedInputAction = newAction; implOnMalformedInput(newAction); return this; }
/** * Sets this decoder's action on malformed input errors. * * This method will call the * {@link #implOnMalformedInput(CodingErrorAction) implOnMalformedInput} * method with the given new action as argument. * * @param newAction * the new action on malformed input error. * @return this decoder. * @throws IllegalArgumentException * if {@code newAction == null}. */ public final CharsetDecoder onMalformedInput(CodingErrorAction newAction) { if (newAction == null) { throw new IllegalArgumentException("newAction == null"); } malformedInputAction = newAction; implOnMalformedInput(newAction); return this; }