1. /*
  2. * @(#)MalformedInputException.java 1.8 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.nio.charset;
  8. /**
  9. * Checked exception thrown when an input byte sequence is not legal for given
  10. * charset, or an input character sequence is not a legal sixteen-bit Unicode
  11. * sequence.
  12. *
  13. * @since 1.4
  14. */
  15. public class MalformedInputException
  16. extends CharacterCodingException
  17. {
  18. private int inputLength;
  19. public MalformedInputException(int inputLength) {
  20. this.inputLength = inputLength;
  21. }
  22. public int getInputLength() {
  23. return inputLength;
  24. }
  25. public String getMessage() {
  26. return "Input length = " + inputLength;
  27. }
  28. }