The following code, http uses the stream to upload pictures to the server, why there is only one close (), and no write () ah?

try {
            inputStream = new FileInputStream(file);
            filePath = UploadFileToFastDFSImpl.uploadFileByStream(inputStream, fileName, file.length());
            is = FileUploadAction.class.getResourceAsStream("/fdfs_client.conf");
            Properties properties = new Properties();
            properties.load(is);
            String port = (String)properties.getProperty("http.tracker_server_port");
            String hostname = (String)properties.getProperty("tracker_server").split(":")[0];
            filePath = "http://"+hostname+":"+port+"/"+filePath;
            inputStream.close();
            is.close();
            file.delete();
            result = "{success:true,filePath:""+filePath+""}";
            System.out.println("----filePath:"+filePath+"is:"+is+"port:"+port+"hostname:"+hostname+"----");
        } catch (IOException e) {
            System.out.println("io");
            e.printStackTrace();
            result = "{success:false}";
        } finally {
Jan.13,2022

File input stream, the file is the source, why write



filePath = UploadFileToFastDFSImpl.uploadFileByStream(inputStream, fileName, file.length());
Menu