Skip to content

Commit

Permalink
Revert "demo: Remove "kohlschutter-util" dependency"
Browse files Browse the repository at this point in the history
This reverts commit 563a1e7.
  • Loading branch information
kohlschuetter committed Nov 13, 2023
1 parent 37d042b commit 7b031d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.newsclub.net.unix.demo.DemoHelper;
import org.newsclub.net.unix.demo.nanohttpd.NanoHttpdServerDemo;

import com.kohlschutter.util.IOUtil;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
Expand Down Expand Up @@ -60,7 +62,7 @@ public static void main(String[] args) throws IOException {
ResponseBody body = response.body();
if (body != null) {
try (InputStream in = body.byteStream()) { // NOPMD.UseTryWithResources
in.transferTo(System.out);
IOUtil.transferAllBytes(in, System.out);
} finally {
body.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import org.newsclub.net.unix.demo.DemoHelper;
import org.newsclub.net.unix.demo.nanohttpd.NanoHttpdServerDemo;

import com.kohlschutter.util.IOUtil;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
Expand Down Expand Up @@ -74,7 +76,7 @@ public static void main(String[] args) throws IOException, InterruptedException
ResponseBody body = response.body();
if (body != null) {
try (InputStream in = body.byteStream()) { // NOPMD.UseTryWithResources
in.transferTo(System.out);
IOUtil.transferAllBytes(in, System.out);
} finally {
body.close();
}
Expand Down

0 comments on commit 7b031d6

Please sign in to comment.