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

后端 未结 3 518
小蘑菇
小蘑菇 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 14:40

    Is this FileInputStream closed automatically by the load() method or is explicit manually intervention required?

    yes it required to close to over come unnecessary leaks.

    Checkout example given in java doc of KeyStore http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html

提交回复
热议问题