TheCodersCorner.com items tagged with java.
Another common compression file format on Linux is the GZIP format. Java again has out of the box support for this file format. Gzip files differ from zip files in that they only contain one file, the compressed form of the original file with a .gz extension. Java's takes such a file type and decompresses it. We can treat ...
is the class used to convert numeric values such as int, long and double into Strings. It has been around since the early days of Java, and generally performs well. Especially if you cache an instance of the class for repeated use. IMHO the only down side to using is that it can look a little verbose. To get...
Java provides support for reading zip files in the form of . This class provides an API where you can iterate over all the items in a given zip file, reading the data from the archive for each file. In order to do this, first you must create the instance giving the file that you wish to expand. Then you...
Copy on write lists provide a very quick win in terms of removing synchronization. I believe that a significant use case is providing a thread safe list for java's Listener (AKA observer) pattern. Copy on write lists make the assumption that the list does not update frequently, and is mainly used for reading. If this is not the case, the overhead...
As a developer I often feel the need to performance tune code, or write "the best piece of code ever". Sometimes this happens even before I know which sections of the code will be executed frequently? These days I make every attempt to hold back from this approach. In applications where performance is critical I usually write it the most natural...
Recently I had a few performance problems with an application that required JVM GC monitoring. It had been so long since the last time I'd had to perform any CG analysis that I had to remind myself of what to do! Using jps and jstat to get JVM GC statistics First, ensure that an appropriate JDK is on your path Next,...