File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/com/marklogic/client/impl Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 101101import okhttp3 .logging .HttpLoggingInterceptor ;
102102import okio .BufferedSink ;
103103import okio .Okio ;
104+ import okio .Source ;
104105import com .burgstaller .okhttp .AuthenticationCacheInterceptor ;
105106import com .burgstaller .okhttp .CachingAuthenticatorDecorator ;
106107import com .burgstaller .okhttp .digest .CachingAuthenticator ;
@@ -5305,7 +5306,9 @@ public void writeTo(BufferedSink sink) throws IOException {
53055306 if ( obj instanceof InputStream ) {
53065307 sink .writeAll (Okio .source ((InputStream ) obj ));
53075308 } else if ( obj instanceof File ) {
5308- sink .writeAll (Okio .source ((File ) obj ));
5309+ try ( Source source = Okio .source ((File ) obj ) ) {
5310+ sink .writeAll (source );
5311+ }
53095312 } else if ( obj instanceof byte [] ) {
53105313 sink .write ((byte []) obj );
53115314 } else if ( obj instanceof String ) {
You can’t perform that action at this time.
0 commit comments