private static void copyStream(final InputStream input, final OutputStream output) throws IOException {
        final byte[] buffer = new byte[1024];
        while (true) {
            final int bytesRead = input.read(buffer);
            if (bytesRead == -1) {
                break;
            }
            output.write(buffer, 0, bytesRead);
        }
    }
This method returns PreviewResult.

@return PreviewResult returns the result by PreviewExecutor
@throws IOException in case of failures in file operations
embulk-junit4/src/main/java/org/embulk/test/TestingEmbulk.java