Typically it's a good idea, sometimes necessary, to close a stream when you're done with it. In the case of a ByteArrayOutputStream though, there's nothing really that needs to be done. So they define close() to do nothing. You're welcome to close the stream by calling close() just like you would for any other stream - it just doesn't do anything. Because there's nothing that needs to be done.