Re: Sweet Home 3D JS Online

by son87a » Fri Oct 29, 2021 12:49 pm

I tried edit code after google. Wrap try in {}
Its working but I don't know write in finally statement.
Sorry, I'm working with PHP, and don't know Java.
Can you fix that ?

Code: Select all

 try {InputStream input = new FileInputStream(homeFile);
              ByteArrayOutputStream output = new ByteArrayOutputStream();
           byte[] buffer = new byte[8096];
           int size;
           while ((size = input.read(buffer)) != -1) {
             output.write(buffer, 0, size);
           }
           homeFileContent = output.toByteArray();
         }
        finally{
           // write something here ?
         }

Code: Select all

try {OutputStream servletOut = response.getOutputStream();
       servletOut.write(homeFileContent);
     }
     finally{
     // write something here ?
    }