| 1 3 import java.io.*; 4 import java.util.*; 5 6 public class TestProps { 7 8 public static void main(String args[]) 9 { 10 try { 11 12 String p = System.getProperty("os.version"); System.out.println("os.version="+p); 14 15 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 16 Properties P = new Properties(System.getProperties()); 17 System.getProperties().save(bos,"basic props"); 18 DataOutputStream ds = new DataOutputStream(bos); 19 ds.writeBytes("awt.image.incrementaldraw=true\n"); 20 ds.writeBytes("awt.image.redrawrate=50\n"); 21 ds.close(); 22 23 byte[] tmp = bos.toByteArray(); 24 ByteArrayInputStream bis = new ByteArrayInputStream(tmp); 25 P.load(bis); 26 System.setProperties(P); 27 System.getProperties().list(System.out); 29 } catch (Exception e) { 30 e.printStackTrace(); 31 } 32 } 33 } 34 35 | Popular Tags |