本文整理了Java中org.fusesource.jansi.WindowsAnsiOutputStream.<init>()
方法的一些代码示例,展示了WindowsAnsiOutputStream.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowsAnsiOutputStream.<init>()
方法的具体详情如下:
包路径:org.fusesource.jansi.WindowsAnsiOutputStream
类名称:WindowsAnsiOutputStream
方法名:<init>
暂无
代码示例来源:origin: jline/jline
/**
* Returns an ansi output stream handler. We return whatever was
* passed if we determine we cannot handle ansi based on Kernel32 calls.
*
* @return an @{link AltWindowAnsiOutputStream} instance or the passed
* stream.
*/
private static OutputStream wrapOutputStream(final OutputStream stream) {
if (Configuration.isWindows()) {
// On windows we know the console does not interpret ANSI codes..
try {
return new WindowsAnsiOutputStream(stream);
} catch (Throwable ignore) {
// this happens when JNA is not in the path.. or
// this happens when the stdout is being redirected to a file.
}
// Use the ANSIOutputStream to strip out the ANSI escape sequences.
return new AnsiOutputStream(stream);
}
return stream;
}
代码示例来源:origin: locationtech/geogig
public boolean checkAnsiSupported(OutputStream out, String osName) throws Throwable {
if (out != System.out) {
return false;
}
if (osName.startsWith("windows") && osName.endsWith("10")) {
new WindowsAnsiOutputStream(out);
} else if (osName.startsWith("windows") && !osName.endsWith("10")) {
return false;
}
if (System.console() == null) {
return false;
}
return true;
}
代码示例来源:origin: org.locationtech.geogig/geogig-cli-core
public boolean checkAnsiSupported(OutputStream out, String osName) throws Throwable {
if (out != System.out) {
return false;
}
if (osName.startsWith("windows") && osName.endsWith("10")) {
new WindowsAnsiOutputStream(out);
} else if (osName.startsWith("windows") && !osName.endsWith("10")) {
return false;
}
if (System.console() == null) {
return false;
}
return true;
}
代码示例来源:origin: org.locationtech.geogig/geogig-cli
public boolean checkAnsiSupported(OutputStream out, String osName) throws Throwable {
if (out != System.out) {
return false;
}
if (osName.startsWith("windows") && osName.endsWith("10")) {
new WindowsAnsiOutputStream(out);
} else if (osName.startsWith("windows") && !osName.endsWith("10")) {
return false;
}
if (System.console() == null) {
return false;
}
return true;
}
代码示例来源:origin: org.aesh/aesh-readline
public WinSysTerminal(String name, boolean nativeSignals, SignalHandler signalHandler) throws IOException {
super(setVTMode(), new WindowsAnsiOutputStream(new FileOutputStream(FileDescriptor.out)), name, nativeSignals, signalHandler);
}
代码示例来源:origin: org.jboss.jreadline/jreadline
@Override
public void init(InputStream inputStream, OutputStream stdOut, OutputStream stdErr) {
if(inputStream == System.in) {
System.out.println("Using System.in");
}
//setting up reader
try {
//AnsiConsole.systemInstall();
this.stdOut = new PrintWriter( new OutputStreamWriter(new WindowsAnsiOutputStream(stdOut)));
this.stdErr = new PrintWriter( new OutputStreamWriter(new WindowsAnsiOutputStream(stdErr)));
}
catch (Exception ioe) {
this.stdOut = new PrintWriter( new OutputStreamWriter(new AnsiOutputStream(stdOut)));
this.stdErr = new PrintWriter( new OutputStreamWriter(new AnsiOutputStream(stdErr)));
}
this.input = inputStream;
}
代码示例来源:origin: org.scala-lang/jline
/**
* Returns an ansi output stream handler. We return whatever was
* passed if we determine we cannot handle ansi based on Kernel32 calls.
*
* @return an @{link AltWindowAnsiOutputStream} instance or the passed
* stream.
*/
private static OutputStream wrapOutputStream(final OutputStream stream) {
String os = System.getProperty("os.name");
if( os.startsWith("Windows") ) {
// On windows we know the console does not interpret ANSI codes..
try {
return new WindowsAnsiOutputStream(stream);
} catch (Throwable ignore) {
// this happens when JNA is not in the path.. or
// this happens when the stdout is being redirected to a file.
}
// Use the ANSIOutputStream to strip out the ANSI escape sequences.
return new AnsiOutputStream(stream);
}
return stream;
}
代码示例来源:origin: com.typesafe.sbt/incremental-compiler
/**
* Returns an ansi output stream handler. We return whatever was
* passed if we determine we cannot handle ansi based on Kernel32 calls.
*
* @return an @{link AltWindowAnsiOutputStream} instance or the passed
* stream.
*/
private static OutputStream wrapOutputStream(final OutputStream stream) {
if (Configuration.isWindows()) {
// On windows we know the console does not interpret ANSI codes..
try {
return new WindowsAnsiOutputStream(stream);
} catch (Throwable ignore) {
// this happens when JNA is not in the path.. or
// this happens when the stdout is being redirected to a file.
}
// Use the ANSIOutputStream to strip out the ANSI escape sequences.
return new AnsiOutputStream(stream);
}
return stream;
}
代码示例来源:origin: com.tngtech.jgiven/jgiven-core
return new WindowsAnsiOutputStream( stream );
} catch( Throwable ignore ) {
代码示例来源:origin: org.fusesource.jansi/jansi
return new WindowsAnsiOutputStream(stream);
} catch (Throwable ignore) {
内容来源于网络,如有侵权,请联系作者删除!