Eager java class loading

I’m trying to do some benchmarking of JVMs running on various hardware and OS platforms. I’ve created an algorithm to exercise the parts of the JVM I’m interested in and intend to run this algorithm …

In java under Windows, how do I find a redirected Desktop folder?

I know using .NET languages such as C#, one can do something like Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) to find the redirected location of the Desktop. However, …

UTF-8 text is garbled when form is posted as multipart/form-data

I’m uploading a file to the server. The file upload HTML form has 2 fields: File name – A HTML text box where the user can give a name in any language. File upload – A HTMl ‘file’ where user can …

How can “while (i == i) ;” be a non-infinite loop in a single threaded application?

I just got a question that I can’t answer. Suppose you have this loop definition in Java: while (i == i) ; What is the type of i and the value of i if the loop is not an infinite loop and the …

Highest Performance Database in Java

I need ideas to implement a (really) high performance in-memory Database/Storage Mechanism in Java. In the range of storing 20,000+ java objects, updated every 5 or so seconds. Some options I am open …

Generated equals in Webservice Stub

All the generated webservice-stubs from our backend have an equals-method similar to this one: private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { …

How do I read / convert an InputStream into a String in Java?

If you have a java.io.InputStream object, how should you process that object and produce a String? Suppose I have an InputStream that contains text data, and I want to convert it to a String, so for …

During execution, how can a java program tell how much memory it is using?

During execution, how can a java program tell how much memory it is using? I don’t care how efficient it is!

How to split a string with any whitespace chars as delimiters

What regex pattern would need I to pass to java.lang.String.split() to split a String into an Array of substrings using all whitespace characters (‘ ‘, ‘t’, ‘n’, etc.) as delimiters?

What is the proper way to store app’s conf data in Java?

Where do you store user-specific and machine-specific runtime configuration data for J2SE application? (For example, C:UsersUSERNAMEAppDataRoaming on Windows and /home/username on Unix) …