誰かが以下のコードをチェックして、もっと良い方法があるかどうかを確認してください。私が本当に心配しているのはパフォーマンスですが、これで何かありますか? そうでない場合、コードの読みやすさを改善するために改善できることはありますか?
try {
URL url = new URL("http://www.pudim.com.br/SiteBuilder/UploadUsers/pudim.com.br/pudim.jpg");
URLConnection uc = url.openConnection();
String type = uc.getContentType();
BufferedImage image = ImageIO.read(url);
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(image, "jpg", os);
byte[] bytes = os.toByteArray();
InputStream is = new ByteArrayInputStream(bytes);
// not important :) ...
} catch (AmazonServiceException e) {
e.printStackTrace();
} catch (AmazonClientException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
どんな考慮事項も歓迎します。
ありがとう!