Should i write
BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(file)); ImageIO.write(im, "JPEG", os);
instead
ImageIO.write(im, "JPEG", file);
those. are imageIO file operations by default or not?
Thank!
If you go in File, the base implementation will write directly in RandomAccessFile(created in mode "rw"), so there will be no buffering. In particular, FileImageOutputStreamwill be used as ImageOutputStream.
File
RandomAccessFile
"rw"
FileImageOutputStream
ImageOutputStream
I believe this depends on the particular implementation IIORegistry, which I believe is system dependent.
IIORegistry
I would expect it to be buffered, but I suppose you could make the first option completely confident.
BufferedOutputStream ( 1, ).
ImageIo.write . , . File .
Source: https://habr.com/ru/post/1753715/More articles:WeakReference in Java inside a stream - javaHow to distinguish bigint to prevent SQL injection in php? - castingПредоставление нескольких баз данных. MySQL - databaseИнформация о файловой системе Query Dynamic с использованием LINQ - c#What should be a json transaction validation check? - app-storeПроблема с запросом на спящий режим с именем - javaHow to configure jndi.properties for DataStore? - javaMySQL date difference - mysqlDatabase Design Considerations - Clarification Required - databaseC # + Resharper - underlined event method - naming convention - c #All Articles