Search in sources :

Example 1 with AnsiOutputStream

use of org.fusesource.jansi.AnsiOutputStream in project gradle by gradle.

the class GroupedOutputFixture method stripAnsiCodes.

private String stripAnsiCodes(String output) {
    try {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        IOUtils.copy(new StringReader(output), new AnsiOutputStream(baos));
        return baos.toString();
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
Also used : AnsiOutputStream(org.fusesource.jansi.AnsiOutputStream) StringReader(java.io.StringReader) UncheckedIOException(org.gradle.api.UncheckedIOException) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) UncheckedIOException(org.gradle.api.UncheckedIOException)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 AnsiOutputStream (org.fusesource.jansi.AnsiOutputStream)1 UncheckedIOException (org.gradle.api.UncheckedIOException)1