Skip to content

Commit

Permalink
Ensure Resource is Closed
Browse files Browse the repository at this point in the history
  • Loading branch information
trobanga committed Jul 11, 2024
1 parent 7d8b79b commit 94632f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/src/main/java/care/smith/fts/util/FhirEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public DataBuffer encodeValue(
MimeType mimeType,
Map<String, Object> hints) {
DataBuffer dataBuffer = bufferFactory.allocateBuffer(128);
OutputStreamWriter w = new OutputStreamWriter(dataBuffer.asOutputStream());
try {

try (OutputStreamWriter w = new OutputStreamWriter(dataBuffer.asOutputStream())) {
log.trace("encode {} to {}", valueType, mimeType);
fhir.newJsonParser().encodeToWriter(value, w);
} catch (IOException e) {
Expand Down

0 comments on commit 94632f7

Please sign in to comment.