Java IO Tutorial - Java CharsetDecoder .malformedInputAction ()


CharsetDecoder.malformedInputAction() has the following syntax.

public CodingErrorAction malformedInputAction()


In the following code shows how to use CharsetDecoder.malformedInputAction() method.

import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
// www.  jav a  2s. c o  m
public class Main {
  public static void main(String[] argv) throws Exception {
    Charset charset = Charset.forName("ISO-8859-1");
    CharsetDecoder decoder = charset.newDecoder();


The code above generates the following result.