+ //***********************\r
+ //* Database cache size\r
+ //***********************\r
+ public static String getDatabaseCacheSize() {\r
+ settings.beginGroup("Debug");\r
+ String text = (String)settings.value("databaseCache", "16384");\r
+ settings.endGroup(); \r
+ return text;\r
+ }\r
+ public static void setDatabaseCache(String value) {\r
+ settings.beginGroup("Debug");\r
+ settings.setValue("databaseCache", value);\r
+ settings.endGroup(); \r
+ }\r
+\r
+ \r
+ \r
+ public static Object deepCopy(Object oldObj) \r
+ {\r
+ ObjectOutputStream oos = null;\r
+ ObjectInputStream ois = null;\r
+ try\r
+ {\r
+ ByteArrayOutputStream bos = \r
+ new ByteArrayOutputStream(); // A\r
+ oos = new ObjectOutputStream(bos); // B\r
+ // serialize and pass the object\r
+ oos.writeObject(oldObj); // C\r
+ oos.flush(); // D\r
+ ByteArrayInputStream bin = \r
+ new ByteArrayInputStream(bos.toByteArray()); // E\r
+ ois = new ObjectInputStream(bin); // F\r
+ // return the new object\r
+ return ois.readObject(); // G\r
+ }\r
+ catch(Exception e)\r
+ {\r
+ Global.logger.log(logger.LOW, "Exception in ObjectCloner = " + e);\r
+ }\r
+ try {\r
+ oos.close();\r
+ ois.close();\r
+ } catch (IOException e) {\r
+ Global.logger.log(logger.LOW, "Exception in ObjectCloner = " + e);\r
+ e.printStackTrace();\r
+ }\r
+\r
+ return null;\r
+ }\r