Reputation: 3204
I'm trying to properly handle an IOException
without having to resort to a tonne of nested try/catch statements.
From reading online I've gathered that this might be the correct way to handle it. but I'm not 100% sure. Is this right?
try (InputStream in = blob.getBinaryStream()) {
while (in.read(bytesRead) != -1) {
byteStream.write(bytesRead);
}
}catch(IOException e){
logger.error("An IOException occurred while streaming a blob from the database", e);
}
Upvotes: 0
Views: 46