Created
April 20, 2022 19:19
-
-
Save osscontributor/7759a5d7c8a3cd6b4e25c7009f139b6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a bad idea | |
File f = File.createTempFile("temp", Long.toString(System.nanoTime())); | |
System.setErr(new PrintStream(new FileOutputStream(f)) { | |
@Override | |
public void println(String x) { | |
throw new RuntimeException(x); | |
} | |
}); | |
System.err.println("overflow!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment