/*
* Copyright (c) 2002-2016, the original author or authors.
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
*/
package jline.internal;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.fusesource.jansi.AnsiOutputStream;
/**
* Ansi support.
*
* @author <a href="mailto:gnodet@gmail.com">Guillaume Nodet</a>
* @since 2.13
*/
public class Ansi {
public static StringstripAnsi(Stringstr) {
if (str == null) return "";
try {
ByteArrayOutputStreambaos = new ByteArrayOutputStream();
AnsiOutputStreamaos = new AnsiOutputStream(baos);
aos.write(str.getBytes());
aos.close();
return baos.toString();
} catch (IOExceptione) {
return str;
}
}
}