java - Is FileOutStream.write(byte[]) always blocking? -


I wonder if FileOutputStream.write (byte []) is always blocking the current thread, from which thread cursing switch It is either turned on or it does not block operation if the OS buffers are large for handling big bytes.

The reason for these thoughts is, I wonder if logging with log 4J in my application is a real demonstration hit, and if logging will be faster to use the queue of messages that Is read by a different thread and the logfiles are written (I know that there is a loss of the logging statement triggered if the app ends and the details given in the queue are not flushed).

No, I have not given it a profile yet, these are rather ideological ideas.

Not required.

FileOutputStream.write (byte []) is an original method. General knowledge can suggest that writing () can write internal buffers, and later it will be committed to actually calling.

Comments