Print at Dec 16, 2025, 9:59:03 AM

Posted by son87a at Oct 29, 2021, 2:49:44 PM
Re: Sweet Home 3D JS Online
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 ?

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 ?
}



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