KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > nio > charset > MalformedInputException


1 /*
2  * @(#)MalformedInputException.java 1.9 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.nio.charset;
9
10
11 /**
12  * Checked exception thrown when an input byte sequence is not legal for given
13  * charset, or an input character sequence is not a legal sixteen-bit Unicode
14  * sequence.
15  *
16  * @since 1.4
17  */

18
19 public class MalformedInputException
20     extends CharacterCodingException JavaDoc
21 {
22
23     private int inputLength;
24
25     public MalformedInputException(int inputLength) {
26     this.inputLength = inputLength;
27     }
28
29     public int getInputLength() {
30     return inputLength;
31     }
32
33     public String JavaDoc getMessage() {
34     return "Input length = " + inputLength;
35     }
36
37 }
38
Popular Tags