OutputStream outputStream = uploadFileUtil.getTargetFileOutputStream(monthlyReportFolder, fileName);
I use a method to return the stream object of the SmbFile object based on the Http file path, that is, I obtain the OutputStream. It is known that this file is an html file. Now I want to read this file into a String object, that is, I want to get the source code in this html file.
Please tell me how to operate,
習慣沉默2017-05-17 10:08:43
What is the specific instance type pointed to by this outputStream?
Assuming it points to a FileOutputStream, you can use code similar to the following to obtain its source code.
OutputStream outputStream = new FileOutputStream(fileName);
ByteArrayOutputStream baos=new ByteArrayOutputStream();
outputStream.write(baos.toByteArray());
str = baos.toString();