title: Java - Is ByteArrayOutputStream safe without flush() and close()?
body: <p>Well, will ByteArrayOutputStream cause memory overflow if it doesn't properly flush and close? I mean are they necessary to be put in the code or Java will garbage-collect it?</p>