Oracle and Java

We always felt that things needed to change in the Java world so have been keenly waiting to see what Oracle would do with Java… Well we got our first clues, last week with a letter from Oracle. Sent by express Fedex from California, the good news is that Oracle clearly has money to spend…

Read More

Java Performance tuning

One of my favourite coding activities is profiling – taking a Java application and making it run faster. Every so often we set aside some time to just focus on making our code run faster. Don’t optimise code where speed does not matter. Not only does it give no benefit, it probably makes that code…

Read More

Java File handling – when is a file actually saved

Consider the following code…. File ff=File.createTempFile(“page”,”.bin”, new File(ObjectStore.temp_dir)); BufferedOutputStream to = new BufferedOutputStream(new FileOutputStream(ff)); to.write(currentDisplay.serializeToByteArray(null));          to.flush();            to.close(); pagesOnDisk.put(key,ff.getAbsolutePath()); It stores a serialised Java Object (currentDisplay) on disk and then stores the file location so we can reuse it. So in theory,  if the value is in the Map pagesOnDisk, we should…

Read More

Printing PDF files from Java

Printing PDF files from Java is something that raises a lot of general questions, so this short article is a general guide to the options available. Java itself contains a built-in print system (JPS). JPS itself does not internally support the PDF file format. There are 3 ways to print PDF files in Java:- 1…

Read More