File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
jsonb/src/main/java/io/avaje/jsonb/core Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 4
4
import io .avaje .jsonb .spi .BufferedJsonWriter ;
5
5
import io .avaje .jsonb .spi .BytesJsonWriter ;
6
6
7
- import java .io .InputStream ;
8
- import java .io .OutputStream ;
9
- import java .io .Reader ;
10
- import java .io .Writer ;
7
+ import java .io .*;
11
8
import java .lang .reflect .Type ;
12
9
import java .util .List ;
13
10
import java .util .Map ;
@@ -93,6 +90,15 @@ public final void toJson(T value, OutputStream outputStream) {
93
90
try (JsonWriter writer = jsonb .writer (outputStream )) {
94
91
adapter .toJson (writer , value );
95
92
}
93
+ close (outputStream );
94
+ }
95
+
96
+ private void close (OutputStream outputStream ) {
97
+ try {
98
+ outputStream .close ();
99
+ } catch (IOException e ) {
100
+ throw new UncheckedIOException ("Error closing stream" , e );
101
+ }
96
102
}
97
103
98
104
@ Override
You can’t perform that action at this time.
0 commit comments