I want to use ZipOutputStream for writing big chunks of bytes what is preferred ?
FileOutputStream fos = new FileOutputStream(fileName);
...
ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(fos));
Or
ZipOutputStream zos = new ZipOutputStream(new PrintStream(fos));
ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(fos));
seems better for at least two reasons :
PrintStream
doesn't throw IOException even if it has a error during the writting in the stream. In case of error, you could have a error in the zip content without knowing it and therefore getting a corrupted zip.
The writing should be more expensive for PrintStream
since all characters printed by a PrintStream are converted into bytes using the platform's default character encoding. The Javadoc advises to use the PrintWriter class in situations that require writing characters rather than bytes.
You could benchmark it to have a confirmation.