Do you need to explicity close a Java KeyStore input stream?

后端 未结 3 560
小蘑菇
小蘑菇 2021-01-14 14:23

When reading in a KeyStore using a FileInputStream as follows, does one need to explicitly close the input-steam to stop system resources being wasted ?

File         


        
3条回答
  •  情书的邮戳
    2021-01-14 15:03

    You should definitly use org.apache.commons.io.IOUtils.closequietly when dealing with streams and APIs you are not sure about

提交回复
热议问题