while (idx < encodedTokens.length()
&& Character.isDigit(encodedTokens.charAt(idx))) {
++idx;
}
if (idx == 0) {
throw new IncompatibleRemoteServiceException(
"Malformed or old RPC message received - expecting version between "
+ SERIALIZATION_STREAM_MIN_VERSION + " and "
+ SERIALIZATION_STREAM_VERSION);
} else {
int version = Integer.valueOf(encodedTokens.substring(0, idx));
throw new IncompatibleRemoteServiceException("Expecting version between "
+ SERIALIZATION_STREAM_MIN_VERSION + " and "
+ SERIALIZATION_STREAM_VERSION + " from client, got " + version
+ ".");
}
}
super.prepareToRead(encodedTokens);
// Check the RPC version number sent by the client
if (getVersion() < SERIALIZATION_STREAM_MIN_VERSION
|| getVersion() > SERIALIZATION_STREAM_VERSION) {
throw new IncompatibleRemoteServiceException("Expecting version between "
+ SERIALIZATION_STREAM_MIN_VERSION + " and "
+ SERIALIZATION_STREAM_VERSION + " from client, got " + getVersion()
+ ".");
}
// Check the flags
if (!areFlagsValid()) {
throw new IncompatibleRemoteServiceException("Got an unknown flag from "
+ "client: " + getFlags());
}
// Read the type name table
deserializeStringTable();