Skip to content

Yet another StreamGobbler implementation for java applications

License

Notifications You must be signed in to change notification settings

yalibs/yastreamgobbler

Repository files navigation

yastreamgobbler

Yet another StreamGobbler implementation for java applications

Usage

First, you need to add the library to your project:

// Add mavenCentral to your repositories
repositories {
    mavenCentral();
}

// Add the library (NOTE: Check the latest version on github)
depdendencies {
    implementation group: 'dk.yalibs', name: 'yaerrors', version: '1.0.0';
}

Then use it e.g. when invoking processes:

import dk.yalibs.yastreamgobbler.StreamGobbler; // Import it

// ...

var process = new ProcessBuilder("ls").start();
var streamGobbler = new StreamGobbler(process.getInputStream(), System.out::println);
var future = executorService.submit(streamGobbler);
var exitCode = process.waitFor();

About

Yet another StreamGobbler implementation for java applications

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages