Is there an actual performance difference when using write(byte[])
methods from FileOutputStream
and BufferedOutputStream
?
I tested both on HDD to write 500 MB file and the result was 13 and 12 seconds:
try(FileOutputStream out = new FileOutputStream(filePath1)) {
out.write(readBytes);
}
and,
try(BufferedOutputStream out = new BufferedOutputStream(
new FileOutputStream(filePath2))) {
out.write(readBytes);
}
What am I missing about BufferedOutputStream
efficiency?