This method of the StandardSecurityManager Class determines if classes within the current execution context, based on the call stack of the current thread, are allowed to set the specified system stream.
public void checkSystemStreams(int streamID);
streamID | The system stream to set. The value must be one of the following:
0 Indicates an attempt to set System.in using System.setIn. 1 Indicates an attempt to set System.out using System.setOut. 2 Indicates an attempt to set System.err using System.setErr. |
The check succeeds only if all the classes found on the call stack possess SystemStreamsPermissions, and if those permissions allow the specified stream to be modified.
This security check is called by the java.lang.System APIs that set system streams using the System.setIn, System.setOut, and System.setErr methods.
SecurityException if the security check fails.