Skip to content

Commit

Permalink
[GEOS-8606]: RawDataEncoderDelegate not closing the stream after copy
Browse files Browse the repository at this point in the history
  • Loading branch information
dromagnoli committed Feb 28, 2018
1 parent 9f4af8a commit 4b709f3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ public void encode(ContentHandler output) throws Exception {
}

public void encode(OutputStream os) throws IOException {
IOUtils.copy(rawData.getInputStream(), os);
InputStream stream = null;
try {
stream = rawData.getInputStream();
IOUtils.copy(stream, os);
} finally {
IOUtils.closeQuietly(stream);
}
}

public RawData getRawData() {
Expand Down

0 comments on commit 4b709f3

Please sign in to comment.