Getting formatted output in file using PrintStream (java 1.4)

217 Views Asked by At

I have to write formatted output in the file in java 1.4 environment (for compatibility). My object is PrintStream out; and I need to write something like: out.format("%-5s", data); How Can I make that possible?

2

There are 2 best solutions below

0
On BEST ANSWER

I realized using out.format will also work, i will need to supply buffer arguments.

2
On

You might try an old implementation of printf that's now redundant for the newer JVMs.