Hi,

now that 3.0 has been released and the Java version was updated to at least 
Java 11 in trunk for the next release, the PDFBox code can be updated in many 
places.

Some methods in IOUtils are now obsolete:

 - `public static long copy(InputStream input, OutputStream output) throws 
IOException` can be replaced by a simple call to input.transferTo(output).
 - `public static byte[] toByteArray(InputStream in) throws IOException` can be 
replaced by `in.readAllBytes()`

Now I could either
 - a) leave those methods in IOUtils and just change the implementations of 
both methods
 - b) remove the methods and make the changes mentioned above at the call sites

I prefer b) because I think it’s the cleaner approach. This means that if 
anybody uses the IOUtils class in their client code, they will have to change 
their code too. But I think that would be alright since 4.0 will be a new major 
release and thinks like that are to be expected.

There’s of course an alternative:
 - c) change the methods implementations and mark the methods in IOUtils as 
deprecated (so they are still available for client code), and at the same time 
change all call sites to use the new methods provided by the JDK.

Which solution is preferred?

Axel


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to