Package java.nio.charset
Class MalformedInputException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
java.nio.charset.CharacterCodingException
java.nio.charset.MalformedInputException
- All Implemented Interfaces:
Serializable
public class MalformedInputException extends CharacterCodingException
A
MalformedInputException is thrown when a malformed input is
encountered, for example if a byte sequence is illegal for the given charset.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description MalformedInputException(int length)Constructs a newMalformedInputException. -
Method Summary
Modifier and Type Method Description intgetInputLength()Gets the length of the malformed input.StringgetMessage()Returns the detail message which was provided when thisThrowablewas created.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MalformedInputException
public MalformedInputException(int length)Constructs a newMalformedInputException.- Parameters:
length- the length of the malformed input.
-
-
Method Details
-
getInputLength
public int getInputLength()Gets the length of the malformed input.- Returns:
- the length of the malformed input.
-
getMessage
Description copied from class:ThrowableReturns the detail message which was provided when thisThrowablewas created. Returnsnullif no message was provided at creation time.- Overrides:
getMessagein classThrowable
-