Skip to content

Commit

Permalink
testcontainers#291 change order
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup committed Feb 21, 2017
1 parent da2a82b commit df7049e
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,26 @@ InetSocketAddress start() throws IOException {
executorService.submit(() -> {
try (RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw")) {
log.info("Created RandomAccessFile from " + file);
Future<Long> inputFuture = executorService.submit(() -> {

Future<Long> outputFuture = executorService.submit(() -> {
try (
InputStream in = incomingSocket.getInputStream();
FileOutputStream out = new FileOutputStream(randomAccessFile.getFD())
FileInputStream in = new FileInputStream(randomAccessFile.getFD());
OutputStream out = incomingSocket.getOutputStream()
) {
log.info("Redirecting input");
log.info("Redirecting output");
return ByteStreams.copy(in, out);
} catch (Exception e) {
log.warn("", e);
return null;
}
});

Future<Long> outputFuture = executorService.submit(() -> {
Future<Long> inputFuture = executorService.submit(() -> {
try (
FileInputStream in = new FileInputStream(randomAccessFile.getFD());
OutputStream out = incomingSocket.getOutputStream()
InputStream in = incomingSocket.getInputStream();
FileOutputStream out = new FileOutputStream(randomAccessFile.getFD())
) {
log.info("Redirecting output");
log.info("Redirecting input");
return ByteStreams.copy(in, out);
} catch (Exception e) {
log.warn("", e);
Expand Down

0 comments on commit df7049e

Please sign in to comment.