Properties originalProps = new Properties();
Properties loadedProps = new Properties();
// Generate a unicode key and value
Random generator = new Random(); int achar=0;
StringBuffer aKeyBuffer = new StringBuffer(120);
StringBuffer aValueBuffer = new StringBuffer(120);
String aKey;
String aValue; for (int x=0; x<300; x++) { for(int y=0; y<100; y++) {
achar = generator.nextInt(); char test; if(achar < 99999) {
test = (char)(achar);
} else { int zz = achar % 10;
test = keyValueSeparators.charAt(zz);
}
aKeyBuffer.append(test);
}
aKey = aKeyBuffer.toString(); for(int y=0; y<100; y++) {
achar = generator.nextInt(); char test = (char)(achar);
aValueBuffer.append(test);
}
aValue = aValueBuffer.toString();
// Attempt to add to original try {
originalProps.put(aKey, aValue);
} catch (IllegalArgumentException e) {
System.err.println("disallowing...");
}
aKeyBuffer.setLength(0);
aValueBuffer.setLength(0);
}
// Destroy old test file if it exists
File oldTestFile = new File("props3");
oldTestFile.delete();
// Save original
System.out.println("Saving...");
OutputStream out = new FileOutputStream("props3");
originalProps.store(out, "test properties");
out.close();
// Load in the set
System.out.println("Loading...");
InputStream in = new FileInputStream("props3"); try {
loadedProps.load(in);
} finally {
in.close();
}
// Compare results if (!originalProps.equals(loadedProps)) thrownew RuntimeException("Properties load and save failed");
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.