public static String stripAnsi(String str) { if (str == null) return ""; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); AnsiOutputStream aos = new AnsiOutputStream(baos); aos.write(str.getBytes()); aos.close(); return baos.toString(); } catch (IOException e) { return str; } }
@Override public void close() throws IOException { closeAttributes(); super.close(); }
@Override public void close() throws IOException { closeAttributes(); super.close(); }
public static String stripAnsi(String str) { if (str == null) return ""; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); AnsiOutputStream aos = new AnsiOutputStream(baos); aos.write(str.getBytes()); aos.close(); return baos.toString(); } catch (IOException e) { return str; } }
private CharSequence chew(final CharSequence str) { assert str != null; ByteArrayOutputStream buff = new ByteArrayOutputStream(); AnsiOutputStream out = new AnsiOutputStream(buff); try { out.write(str.toString().getBytes()); out.flush(); out.close(); } catch (IOException e) { throw new RuntimeException(e); } return new String(buff.toByteArray()); }
private String stripAnsi(final String str) { if (str == null) return ""; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); AnsiOutputStream aos = new AnsiOutputStream(baos); aos.write(str.getBytes()); aos.flush(); aos.close(); return baos.toString(); } catch (IOException e) { return str; } }