I use a StringReader
to turn a string into something I can upload to an SFTP server (it takes a stream). Is there any point in closing that StringReader
afterwards? As far as I can see in the source it just sets the string to null
...
I could just do it, but since the close method is marked as throwing an IOException
and all I have to wrap it in a try catch and the code just ends up looking a lot more horrible than it perhaps needs to be.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…