summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/adapter
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado/adapter')
-rw-r--r--src/main/java/com/amazon/carbonado/adapter/TextAdapter.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/adapter/TextAdapter.java b/src/main/java/com/amazon/carbonado/adapter/TextAdapter.java
index 8a51c3f..8a7542d 100644
--- a/src/main/java/com/amazon/carbonado/adapter/TextAdapter.java
+++ b/src/main/java/com/amazon/carbonado/adapter/TextAdapter.java
@@ -233,8 +233,11 @@ public @interface TextAdapter {
Writer w = new OutputStreamWriter(blob.openOutputStream(), encoder);
try {
- w.write(text, 0, text.length());
- w.close();
+ try {
+ w.write(text, 0, text.length());
+ } finally {
+ w.close();
+ }
} catch (IOException e) {
throw toPersistException(e);
}