private RuntimeException wrapException(String message, final JSONException ex) {
message = "Error " + message + " from JSON stream";
if (ex.getCause() instanceof IOException) {
return new FudgeRuntimeIOException(message, (IOException) ex.getCause());
} else {
return new FudgeRuntimeException(message, ex);
}
}