try {
this.dataIn.mark(17);
int type = this.dataIn.read();
if (type == -1) {
throw new OpenwireException("reached end of data");
}
if (type == MarshallingSupport.SHORT_TYPE) {
return this.dataIn.readShort();
}
if (type == MarshallingSupport.BYTE_TYPE) {
return this.dataIn.readByte();
}
if (type == MarshallingSupport.STRING_TYPE) {
return Short.valueOf(this.dataIn.readUTF()).shortValue();
}
if (type == MarshallingSupport.NULL) {
this.dataIn.reset();
throw new NullPointerException("Cannot convert NULL value to short.");
} else {
this.dataIn.reset();
throw new OpenwireException(" not a short type");
}
} catch (NumberFormatException mfe) {
try {
this.dataIn.reset();
} catch (IOException ioe) {
throw new OpenwireException(ioe);
}
throw mfe;
} catch (EOFException e) {
throw new OpenwireException(e);
} catch (IOException e) {
throw new OpenwireException(e);
}
}