Created
October 22, 2019 10:31
-
-
Save HyeonUkCho/27c1418058873eab01a5835c8f8ae8b7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public void testCleanUp() { | |
try { | |
@Cleanup ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
baos.write(new byte[] {'Y','e','s'}); | |
System.out.println(baos.toString()); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
public void testCleanUp() { | |
try { | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
try { | |
baos.write(new byte[]{'Y', 'e', 's'}); | |
System.out.println(baos.toString()); | |
} finally { | |
baos.close(); | |
} | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment