java.io

Class UTFDataFormatException

Implemented Interfaces:
Serializable

public class UTFDataFormatException
extends IOException

Signals that a malformed string in modified UTF-8 format has been read in a data input stream or by any class that implements the data input interface. See the DataInput class description for the format in which modified UTF-8 strings are read and written.
Since:
JDK1.0
See Also:
DataInput, DataInputStream.readUTF(DataInput), IOException, Serialized Form

Constructor Summary

UTFDataFormatException()
Constructs a UTFDataFormatException with null as its error detail message.
UTFDataFormatException(String s)
Constructs a UTFDataFormatException with the specified detail message.

Method Summary

Methods inherited from class java.lang.Throwable

fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

UTFDataFormatException

public UTFDataFormatException()
Constructs a UTFDataFormatException with null as its error detail message.
Usages and Demos :

View More Examples of UTFDataFormatException()
   1:                     if (count > utflen)
   2:                         throw new UTFDataFormatException();
   3:                     char2= readByte();
   4:         ...
   5:                     if ((char2 & 0xC0) != 0x80)
   6:                         throw new UTFDataFormatException();
   7:                     str[strlen++]= (char) (((c & 0x1F) << 6) | (char2 & 0x3F));
   8:         ...
   9:                     if (count > utflen)
  10:                         throw new UTFDataFormatException();
  11:                     char2= readByte();

View Full Code Here
   1:                         if (count > utflen) {
   2:                             throw new UTFDataFormatException();
   3:                         }
   4:         ...
   5:                         if ((char2 & 0xC0) != 0x80) {
   6:                             throw new UTFDataFormatException();
   7:                         }
   8:         ...
   9:                     case 14:
  10:                         throw new UTFDataFormatException();
  11:                 }

View Full Code Here
   1:                 default:
   2:                     throw new UTFDataFormatException();
   3:                 }
   4:         ...
   5:                     if ((char2 & 0xC0) != 0x80) {
   6:                         throw new UTFDataFormatException();
   7:                     }
   8:         ...
   9:                     if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80))
  10:                         throw new UTFDataFormatException();
  11:                     chars[charOffset++] = (char)(((char1 & 0x0F) << 12) |

View Full Code Here
   1:                         if (count > utflen) {
   2:                             throw new UTFDataFormatException();
   3:                         }
   4:         ...
   5:                         if ((char2 & 0xC0) != 0x80) {
   6:                             throw new UTFDataFormatException();
   7:                         }
   8:         ...
   9:                     case 14:
  10:                         throw new UTFDataFormatException();
  11:                 }

View Full Code Here
   1:                         if (count > utflen) {
   2:                             throw new UTFDataFormatException();
   3:                         }
   4:         ...
   5:                         if ((char2 & 0xC0) != 0x80) {
   6:                             throw new UTFDataFormatException();
   7:                         }
   8:         ...
   9:                     case 14:
  10:                         throw new UTFDataFormatException();
  11:                 }

View Full Code Here

UTFDataFormatException

public UTFDataFormatException(String s)
Constructs a UTFDataFormatException with the specified detail message. The string s can be retrieved later by the Throwable.getMessage() method of class java.lang.Throwable.
Parameters:
s - the detail message.
Usages and Demos :

View More Examples of UTFDataFormatException(String s)
   1:         if (uselen < 2 || buf[uselen-1] != 0x0A || buf[uselen-2] != 0x0D) 
   2:             throw new UTFDataFormatException("KLisCRLF");
   3:         uselen -= 2;
   4:     }
   5:     else {

View Full Code Here
   1:         if (utflen > 0xFFFF) {
   2:             throw new UTFDataFormatException(String.valueOf(str));
   3:         }
   4:         ensure(utflen + 3);
   5:         constant_pool[top++] = Constants.CONSTANT_Utf8;

View Full Code Here
   1:         closeIn();
   2:         return new UTFDataFormatException(s);
   3:     }
   4: 
   5:     private IOException utfFormatException() {

View Full Code Here
   1:         new Object [] {Integer.toString(position), Integer.toString(count)});
   2:         throw new UTFDataFormatException(message);
   3:         
   4:     

View Full Code Here